Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql-contrib #4

Closed
brianbroderick opened this issue Jun 19, 2017 · 19 comments
Closed

postgresql-contrib #4

brianbroderick opened this issue Jun 19, 2017 · 19 comments

Comments

@brianbroderick
Copy link

PG::UndefinedFile: ERROR:  could not open extension control file "/Users/myuser/.asdf/installs/postgres/9.6.3/share/extension/uuid-ossp.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"

I'm getting this error when I try and install the uuid-ossp extension. Googling around suggests that postgresql-contrib needs to be installed.

How can I install things like postgresql-contrib with asdf?

Thanks.

@smashedtoatoms
Copy link
Owner

Sorry Brian, I just saw this. So you should be able to run something like env POSTGRES_EXTRA_CONFIGURE_OPTIONS=--with-uuid=ossp asdf install postgres 9.6.3 and have it install what you're wanting, assuming you have the ossp-uuid libs installed. I'd recommend not using ossp though, if you have a choice, because I don't think it's maintained any longer. I don't think it's been updated since 2008, and I have had a hell of a time with it on mac in the past. I usually use e2fs. Let me know if that works for you.

@emilford
Copy link

emilford commented Dec 10, 2017

I tried going down the --with-uuid=ossp path, but ran into needing to brew install ossp-uuid and then errors about finding ossp header files, but not being able to compile them.

In researching this, I read in several places that discussed abandonment of ossp-uuid and noticed that the homebrew formula uses --with-uuid=e2fs. I brew uninstall ossp-uuid and then was able to run POSTGRES_EXTRA_CONFIGURE_OPTIONS=--with-uuid=e2fs asdf install postgres 9.6.6.

I wasn't convinced this was going to work, since the Postgres extension is called uuid-ossp, but so far this seems to be working just fine for me.

Hope this helps.

@djcp
Copy link

djcp commented Sep 27, 2018

On ubuntu 16.04, I was able to get ossp-uuid working by:

sudo apt install libossp-uuid-dev
POSTGRES_EXTRA_CONFIGURE_OPTIONS=--with-uuid=ossp asdf install postgres 10.4

e2fs worked fine too (surprisingly!) according to @emilford 's instructions with no extra lib installs.

@st23am
Copy link

st23am commented Apr 25, 2019

Hate to tag onto this but, is there a list of other extensions for POSTGRES_EXTRA_CONFIGURE_OPTIONS ? I am getting an error failed: sslmode value "require" invalid when SSL support is not compiled in Maybe I just need to add --with-ssl ?

@st23am
Copy link

st23am commented Apr 25, 2019

Coming back for future users the correct configure opt is POSTGRES_EXTRA_CONFIGURE_OPTIONS=--with-openssl

@jc00ke
Copy link

jc00ke commented Sep 25, 2019

I'd love to see --with-openssl as a default, as I went down a rabbit hole with Heroku support trying to figure out why heroku pg:psql wouldn't work.

@kenny-evitt
Copy link
Contributor

I ran into this but running install with the 'extra options' variable set didn't work:

$ POSTGRES_EXTRA_CONFIGURE_OPTIONS=--with-uuid=ossp asdf install postgres 9.4.5
postgres 9.4.5 is already installed

I'm guessing I need to uninstall it first.

@smashedtoatoms
Copy link
Owner

That particular error does mean that you need to uninstall first.

@smashedtoatoms
Copy link
Owner

I'd love to see --with-openssl as a default, as I went down a rabbit hole with Heroku support trying to figure out why heroku pg:psql wouldn't work.

The only reason I haven't done this is openssl always ends up being a nightmare in and of itself. I am certainly willing to try it out if folks thing it would be beneficial.

@kenny-evitt
Copy link
Contributor

@smashedtoatoms After re-installing, I can't connect via psql:

$ psql -d postgres
psql: FATAL:  could not open relation mapping file "global/pg_filenode.map": No such file or directory

@kenny-evitt
Copy link
Contributor

kenny-evitt commented Oct 21, 2019

@smashedtoatoms Maybe my shims are messed-up?:

$ pg_ctl status
pg_ctl: no server running
$ /home/kenny/.asdf/installs/postgres/9.4.5/bin/pg_ctl status
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.

Or maybe it's because I didn't stop the server I'd started before uninstalling?

@kenny-evitt
Copy link
Contributor

kenny-evitt commented Oct 21, 2019

@smashedtoatoms Sorry for the notifications spam! I seem to have fixed the problem by kill-ing the errant postgres process and then restarting via pg_ctl ... start.

Re-installing with the 'with extra options' resolved the original issue with the OSSP extension too – thanks!

@smashedtoatoms
Copy link
Owner

Sweet, no problem at all. I am stoked it worked. I honestly made this plugin for myself ages ago and never thought anyone would use it other than me, so seeing it take on the life it has is fascinating to me.

@kenny-evitt
Copy link
Contributor

@smashedtoatoms It's very useful! Thanks! And it's really awesome that you respond on GitHub, let alone so quickly; very generous of you.

@smashedtoatoms
Copy link
Owner

Oh man, go through some of the other issues. I saw one today from almost 2 years ago that I just replied to. I don't know how I missed it. That guy has had a different experience. I am appropriately ashamed though.

@jc00ke
Copy link

jc00ke commented May 14, 2020

Ran into this again... is there some testing we can help with to get --with-openssl set as the default?

@smashedtoatoms
Copy link
Owner

Yea, it won't be hard to make the default. I just have no idea what it will break. Let me do it and see if it breaks anything obvious for me. If it's an easy workaround or doesn't cause any issues I guess we can just do it and see who notices.

@smashedtoatoms
Copy link
Owner

Sorry that this has taken so long to get to. I am looking at it now, and --with-openssl isn't happening as a default until openssl isn't such a ghetto on macs. I can't get it to build on mac without setting up symlinks to libraries I installed with brew, which is a bridge too far for me. If anyone has ways to work through library 'crypto' is required for OpenSSL that don't require installing openssl and symlinking all over the place, that would be cool, but as it is, if I make that the default, I will end up explaining how to do that every few days here. Sorry everyone. I want to be more helpful, but openssl is objectively terrible.

@ersinakinci
Copy link

ersinakinci commented Jan 25, 2021

For anyone coming from the internet using macOS and Homebrew on Apple Silicon, I used the following to install Postgres 11.5:

LDFLAGS="-arch x86_64 -L/usr/local/opt/openssl/lib" CPPFLAGS="-arch x86_64 -I/usr/local/opt/openssl/include" POSTGRES_EXTRA_CONFIGURE_OPTIONS="--with-openssl --with-uuid=e2fs" arch -x86_64 asdf install postgres 11.5

The -L/usr/local/opt/openssl/lib and -I/usr/local/opt/openssl/include options point Postgres' configure script to brew's version of OpenSSL, which isn't linked into your default paths because brew doesn't override Apple's version of OpenSSL.

Unlike @st23am, I found that I still had to include --with-uuid. --with-uuid=e2fs works fine without any additional libraries from Homebrew, it seems to use the native version on your Mac despite compiling for x86 (see below). I'm not sure whether --with-openssl is strictly required in order to get --with--uuid=e2fs working, but it doesn't hurt.

All the arch -x86_64 stuff is for compiling and linking x86 binaries, which will be executed using Rosetta. I've found that native Apple silicon Postgres is flaky, as of writing. Hopefully this step won't be needed for much longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants