Following the advice given on another answer, I tried using the digest() function on PostgreSQL 9.3 on AWS RDS:

devdb=> SELECT digest('blah', 'sha1');
ERROR:  function digest(unknown, unknown) does not exist
LINE 1: SELECT digest('blah', 'sha1');
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Even though pgcrypto exist:

devdb=> SHOW rds.extensions;


How can I enable the digest() function?


I have co-asked on the AWS RDS forum, will posts mutually updated.

digest() does not seem to exist on the db:

devdb=> \df digest
                       List of functions
 Schema | Name | Result data type | Argument data types | Type
(0 rows)
  • Output of \df digest in psql? Commented Oct 28, 2014 at 9:37

2 Answers 2


The question was answered at the AWS forum by Shawn@AWS - The rds.extension list shows available, rather than installed, modules.

Thank you for using RDS Postgres. The "rds.extension" parameter shows you what extensions are available in RDS Postgres. You still need to execute the "create extension" command.

Using your test case:

postgres=> show rds.extensions;
... ,pgcrypto, ...
postgres=> create extension pgcrypto;

postgres=> SELECT digest('blah', 'sha1');
(1 row)


pg_available_extensions shows which extensions are available and which are already installed:

postgres=> SELECT * FROM pg_available_extensions;

          name          | default_version | installed_version |                               comment
 chkpass                | 1.0             |                   | data type for auto-encrypted passwords
 xml2                   | 1.0             |                   | XPath querying and XSLT
 plpgsql                | 1.0             | 1.0               | PL/pgSQL procedural language
 pgcrypto               | 1.0             |                   | cryptographic functions
 postgres_fdw           | 1.0             |                   | foreign-data wrapper for remote PostgreSQL servers
  • Addendum Addendum: Extensions have to be created once per database. And the pgcrypto extension is special as it can only be created by the database superuser (normally postgres). With peer auth enabled as usual on Ubuntu etc., the following command would bring you to the correct prompt to create the extension: sudo -u postgres psql -U postgres -d database_name
    – tanius
    Commented Dec 9, 2016 at 1:55
  1. sudo apt-get install postgresql-contrib-9.1 or depending on your postgres version (Check debian pkg or depending on your distrib)

  2. in postgres: CREATE EXTENSION pgcrypto;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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