I have this password hash function that hashes a password to sha256. I've already got it running in pgadmin3 in a local database. I've done it by importing the extension, a feature that has been added a few versions ago.

To my schoolwork I need to run the trigger in a phppgadmin server but when I execute


I get

ERROR:  could not open extension control file "/usr/share/postgresql/9.1/extension/pgcrypto.control": No such file or directory

How can I resolve this without having to change my hash to a weaker one (md5 or sha1)?

closed as unclear what you're asking by Evan Carroll, RDFozz, Erik Darling, Mr.Brownstone, ypercubeᵀᴹ Dec 8 '17 at 23:08

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


I'm assuming that you want to create this extension in another server. I'm guessing that the server didn't get the "postgresql contrib" package installed. This package contains the "standard" extensions that are available from the PostgreSQL source code.

I think you need to get the system administrator to install the required package for your OS.

For Debian and Ubuntu it's the "postgresql-contrib-9.1" package, for other platforms it has a similar name.

  • 1
    You need to do sudo apt-get install postgresql-contrib-9.1 or it depends on the version of your postgres. – eloone Apr 14 '17 at 19:57
  • For Alpine Linux, apk add postgresql-contrib. – Arto Bendiken Jan 25 at 0:36

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