2

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!

phil
  • 526
  • 6
  • 16

2 Answers2

4

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.

2

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

  1. /usr/local/Cellar/pgroonga/xxx/share/postgresql -> /Applications/Postgres.app/Contents/Versions/xxx/share/postgresql

  2. /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.

Mizuki
  • 2,153
  • 1
  • 17
  • 29
  • After trying this solution, I'm now getting : `ERROR: could not load library "/Applications/Postgres.app/Contents/Versions/12/lib/postgresql/pgroonga.so": dlopen(/Applications/Postgres.app/Contents/Versions/12/lib/postgresql/pgroonga.so, 10): Symbol not found: _build_reloptions Referenced from: /Applications/Postgres.app/Contents/Versions/12/lib/postgresql/pgroonga.so Expected in: /Applications/Postgres.app/Contents/Versions/12/bin/postgres in /Applications/Postgres.app/Contents/Versions/12/lib/postgresql/pgroonga.so`. Do you have an idea what this is? thank you. – BVtp Nov 21 '20 at 07:31