问题
I'm just following the instructions here for installing the pgroonga add-on for Postgres but when I get to this step:
% psql -d pgroonga_test --command 'CREATE EXTENSION pgroonga;'
I get the following error:
ERROR: could not open extension control file "/Applications/Postgres.app/Contents/Versions/9.6/share/postgresql/extension/pgroonga.control": No such file or directory
I assume it's looking in the wrong location since I installed Postgres with the app and pgroonga using brew. I also tried building pgroonga from source and completely re-installing Postgres. Nothing seems to work.
If anyone could point me into the right direction it would be greatly appreciated. And thanks in advance for helping out a newb!
回答1:
If PostgreSQL is newly installed, don't forget to start PostgreSQL
$ brew services start postgresql
For PostgreSQL installation with Homebrew, there is a good post.
In my case, I installed postgresapp.
My postgresapp location is /Applications/Postgres.app/Contents/Versions/xxx/.
And I installed PGroonga by Homebrew:$ brew install pgroonga.
My PGroonga directory is /usr/local/Cellar/pgroonga/xxx.
I manually put pgroonga lib in postgresapp extensions folder. I copy all files as following
/usr/local/Cellar/pgroonga/xxx/share/postgresql -> /Applications/Postgres.app/Contents/Versions/xxx/share/postgresql
/usr/local/Cellar/pgroonga/xxx/lib -> /Applications/Postgres.app/Contents/Versions/xxx/lib/postgresql
Restart postgresapp.
Now ready to install pgroonga extension into the database with pgadmin4 GUI.
回答2:
When you build from sources, make sure your PATH contains PostgresApp binary installation:
$ export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
$ which pg_config
/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
Now you can build the extension from sources and make install should install the files in the location expected by PostgresApp.
来源:https://stackoverflow.com/questions/45736639/installing-pgroonga-on-macosx-with-postgres-app