How can I get access to password hashing in postgresql? Tried installing postgresql-contrib in ubun

Posted by Tchalvak on Server Fault See other posts from Server Fault or by Tchalvak
Published on 2010-04-15T19:50:18Z Indexed on 2010/04/15 19:53 UTC
Read the original article Hit count: 714

So I'm trying to just hash some passwords in postgresql, and the only hashing solution that I've found for postgresql is part of the pgcrytpo package ( http://www.postgresql.org/docs/8.3/static/pgcrypto.html ) that is supposed to be in postgresql-contrib ( http://www.postgresql.org/docs/8.3/static/contrib.html ).

So I installed postgresql-contrib, (sudo apt-get install postgresql-contrib), restarted my server (as a simple way to restart postgresql).

However, I still don't have access to any of the functions for hashing that are supposed to be in postgresql-contrib, e.g.:

ninjawars=# select crypt('global salt' || 'new password' || 'user created date', gen_salt('sha256')); ERROR: function gen_salt(unknown) does not exist

ninjawars=# select digest('test', 'sha256') from players limit 1; ERROR: function digest(unknown, unknown) does not exist

ninjawars=# select hmac('test', 'sha256') from players limit 1; ERROR: function hmac(unknown, unknown) does not exist

So how can I hash passwords in postgresql, on ubuntu?

© Server Fault or respective owner

Related posts about postgresql

Related posts about postgresql-contrib