jiwopene
jiwopene

Reputation: 3627

postgresql – No crypt function on Debian stretch

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?


Installed postgresql packages

Upvotes: 3

Views: 5277

Answers (1)

jiwopene
jiwopene

Reputation: 3627

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.

Upvotes: 17

Related Questions