I have PostgreSQL 9.6 installation on my Debian Stretch (9). When I want to use crypt()
or gen_salt()
functions, it says:
ERROR: function gen_salt(unknown, integer) does not exist
LINE 1: select gen_salt('bf', 8)
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
How can I get these functions working?
You have to enable it using SQL:
CREATE EXTENSION IF NOT EXISTS pgcrypto;
You have to do it on each database that uses pgcrypto functions.