Ho to install SHA-1 support for PostgreSQL
cd contrib/pgcrypto
make; make install start psql and create a utility function: psql -Upostgres template1 -- for Postgres < 9.1:
template1=# \i contrib/pgcrypto/pgcrypto.sql
-- for Postgres >= 9.1:
template1=# CREATE EXTENSION pgcrypto; -- common part:
template1=# CREATE OR REPLACE FUNCTION sha1(varchar) returns text AS '
SELECT encode(digest($1::bytea, ''sha1''), ''hex'')
' LANGUAGE SQL STRICT IMMUTABLE;
Links:
How to add sha1() to PostgreSQL? (http://raveica.comdurav.com)
Postgres Documentation: F.20. pgcrypto (http://www.postgresql.org)
How to add sha1() to PostgreSQL? (http://raveica.comdurav.com)
Postgres Documentation: F.20. pgcrypto (http://www.postgresql.org)