Installing pgroonga on macosx (with Postgres.app)

浪子不回头ぞ 提交于 2021-01-28 14:20:28

问题


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

  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.




回答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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!