I'm using Ubuntu Server 10.10 and I have installed PostgreSQL 8.4 using apt-get install postgresql
. I would like to use the built-in sha1()
function, but it seems that I have to install pgcrypto
first. But I don't know how to install it.
There is no pgcrypto
if I try to install it using apt-get install pgcrypto
and I don't find any files starting with pgcrypto
in my system (I tried find / -name "pgcrypto*"
).
How do I install pgcrypto so I can use the digest('word-to-hash','sha1')
function in my database queries?
Update: I'm struggling to install pgcrypto on another Ubuntu machine. After installing the package using sudo apt-get install postgresql-contrib-8.4
how do I install it to my current PostgreSQL database?
/usr/local/pgsql/share/contrib/pgcrypto.sql
and let us know./usr/local/pgsql
directory. The only place where I have*.sql
files are in/usr/share/postgresql/8.4/
but no crypto-related.