0

I need to add an extension called unaccent to my postgres database.

Postgres version PostgreSQL version: 9.3rc1

I have a problem to install the extension.

What i did:

sudo apt-get install postgresql-contrib-9.1

I know it's with 9.1 version, but on my test server i did everyting the same with postgres version 9.4, and everything works.

When i run a script on my production server

CREATE EXTENSION unaccent schema pg_catalog;

it throws me an error :

could not open extension control file "/usr/local/pgsql/share/extension/unaccent.control": Directory or file doesn't exist

What is the problem in this case? Extension has been installed into "wrong" (i guess) directory /usr/share/postgresql/9.1/extension instead of usr/local/pgsql/share/extension

Is there any chance to make postgres look into other directory than default for extensions?

mArtinko5MB
  • 756
  • 8
  • 18
  • *Everything* here is backwards. Install a current version of Postgres and the matching contrib module. And don't install extensions to `pg_catalog`. Only some extensions are meant to live there. – Erwin Brandstetter Sep 05 '16 at 13:34

1 Answers1

1

Don't use PostgreSQL 9.3rc1. Just don't. That's not a production version.

You have to install the contrib modules from the same source and in the same version as PostgreSQL core. Everything else won't work.

So this is what you should do:

  1. Upgrade PostgreSQL to something more recent, at leat 9.3.14.

  2. Install the contrib modules from the same provider in the same version.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263