Tuesday, April 26, 2022

[SOLVED] postgresql – No crypt function on Debian stretch

Issue

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


Solution

You have to enable it using SQL:

CREATE EXTENSION pgcrypto;

You have to do it on each database that uses pgcrypto functions.



Answered By - jiwopene
Answer Checked By - Mary Flores (WPSolving Volunteer)