Error during install extensions in Postgresql 9.2

postgresql, sql

Solution

At a wild guess, you've downloaded the PostgreSQL 9.2 sources to `/usr/src`, unpacked it, configured it, compiled and installed it ... but not installed the contribs.

If so, from the PostgreSQL source dir:

cd contrib && make && sudo make install

If you want updated PostgreSQL releases, it's usually better to get them packaged unless you need/want to make source code changes. See http://yum.postgresql.org/, http://apt.postgresql.org/, http://www.postgresql.org/download/, ...

Update: Some of these have dependencies. E.g. for `uuid-ossp` you must install the ossp-uuid lib first:

apt-get install libossp-uuid-dev

then compile and install `contrib/uuid-ossp`:

cd contrib/uuid-ossp && make && make install

Check the error output from the `make` step for more info, and if in doubt, remember, Google. The first error is usually the most important.

Problem

I have tried following: ``` sudo -u postgres psql <enter> create extension "uuid-ossp"; ``` but showing error: `ERROR: could not access file "$libdir/uuid-ossp": No such file or directory` I have tried: `select version()`. It's showing my postgresql version `PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1, 64-bit` Later tried to install extension `adminpack` using `create extension "adminpack"` but it's also throwing error: `ERROR: could not open extension control file "/usr/local/share/postgresql/extension/adminpack.control": No such file or directory` I have tried `locate uuid-ossp` which gave me following result: ``` /usr/src/postgresql-9.2.4/contrib/uuid-ossp /usr/src/postgresql-9.2.4/contrib/uuid-ossp/Makefile /usr/src/postgresql-9.2.4/contrib/uuid-ossp/uuid-ossp--1.0.sql /usr/src/postgresql-9.2.4/contrib/uuid-ossp/uuid-ossp--unpackaged--1.0.sql /usr/src/postgresql-9.2.4/contrib/uuid-ossp/uuid-ossp.c /usr/src/postgresql-9.2.4/contrib/uuid-ossp/uuid-ossp.control /usr/src/postgresql-9.2.4/doc/src/sgml/uuid-ossp.sgml /usr/src/postgresql-9.2.4/doc/src/sgml/html/uuid-ossp.html ``` `locate adminpack` is giving following result: ``` /usr/lib/postgresql/9.1/lib/adminpack.so /usr/share/postgresql/9.1/extension/adminpack--1.0.sql /usr/share/postgresql/9.1/extension/adminpack.control /usr/src/postgresql-9.2.4/contrib/adminpack /usr/src/postgresql-9.2.4/contrib/adminpack/Makefile /usr/src/postgresql-9.2.4/contrib/adminpack/adminpack--1.0.sql /usr/src/postgresql-9.2.4/contrib/adminpack/adminpack.c /usr/src/postgresql-9.2.4/contrib/adminpack/adminpack.control /usr/src/postgresql-9.2.4/doc/src/sgml/adminpack.sgml /usr/src/postgresql-9.2.4/doc/src/sgml/html/adminpack.html ```

Original source