Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

On PostgreSQL 9.2.3 when trying this:

CREATE EXTENSION btree_gist;

I get this error:

ERROR: could not open extension control file "/opt/local/share/postgresql92/extension/btree_gist.control": No such file or directory

Running SELECT pg_available_extensions(); shows that indeed is not available.

share|improve this question
    
Googling shows that it's supplied as a .sql file that you run. –  Phil Mar 22 '13 at 22:36
    
Probably, depending on the way you have installed Postgres, there's an extra "contrib" package you need to install –  Milen A. Radev Mar 22 '13 at 23:07

1 Answer 1

up vote 2 down vote accepted

The problem is that the needed contrib files are not installed. This was actually the case for several contrib modules.

I found help with the solution to this here:
https://wiki-bsse.ethz.ch/display/ITDOC/Get+PostgreSQL+contrib+modules+on+Mac+OS+X

$ su
# port build postgresql92
# cd `port work postgresql92`/postgresql-<version>/contrib
# for d in *; do test -d $d && ( echo $d; cd $d; make all && make install; cd .. ); done

I suspect reinstalling everything would work too, but this highlights the actual problem.

share|improve this answer
    
I recently installed 9.3 (sudo port install postgresql93-server) and uninstalled 9.2 (sudo port uninstall <all related ports>). Today, upon doing a restore I found that CREATE EXTENSION didn't work for this same reason. Executing the above four lines for the appropriate version fixed the problem. –  Denver Timothy Sep 12 '13 at 4:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.