Вопрос

Я пытаюсь загрузить модуль PG_TRGM в PostgreSQL, но что-то не так:

$ psql -d simko_development -f /usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql
SET
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:9: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:14: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:19: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:24: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:29: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:38: ERROR:  function similarity_op(text, text) does not exist
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:44: NOTICE:  type "gtrgm" is not yet defined
DETAIL:  Creating a shell type definition.
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:44: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:49: ERROR:  type gtrgm does not exist
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:55: ERROR:  function gtrgm_in(cstring) does not exist
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:61: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:66: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:71: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:76: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:81: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:86: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:91: ERROR:  type gtrgm does not exist
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:105: ERROR:  operator does not exist: text % text
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:111: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:116: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:121: ERROR:  could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:132: ERROR:  operator does not exist: text % text
  • Mac OS X 10.6.6
  • PostgreSQL 9.0.2 (Наблюдается через домощь)

Больше информации:

$ pg_config --sharedir
/usr/local/Cellar/postgresql/9.0.2/share
Это было полезно?

Решение 3

Общая переустановка PostgreSQL была помогать мне.

Другие советы

Не могу помочь вам с MacOS, но тот же проблем часто встречается на установках Debian-Linux. Решение там очень просто: требуемые библиотеки расположены в отдельном пакете, названном postgresql-contrib, который должен быть установлен дополнительно к основным postgresql упаковка.

Я знаю это старый вопрос, но я нашел его, используя Google, чтобы другие могли здесь также в конечном итоге.

На моем Mac OSX MacPorts установите, у меня были две папки с файлами .so для PostgreSQL:

/opt/local/lib/postgresql90/

и

/usr/local/pgsql-9.0/lib/

Похоже, моя установка посмотрела в / opt / local / lib / postgresql90 / и не в /usr/local/pgsql-9.0/lib/, поэтому для установки PG_TRGM я должен был сделать следующее:

sudo ln -s /opt/local/lib/postgresql90/pg_trgm.so /usr/local/pgsql-9.0/lib/

Это должно работать с любым файлом .so, который не находится в нужном месте.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top