summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/sql/crypt-md5.sql
blob: 0002f0d34d72b6be6450357feb145c50484e959b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--
-- crypt() and gen_salt(): md5
--

SELECT crypt('', '$1$Szzz0yzz');

SELECT crypt('foox', '$1$Szzz0yzz');

CREATE TABLE ctest (data text, res text, salt text);
INSERT INTO ctest VALUES ('password', '', '');

UPDATE ctest SET salt = gen_salt('md5');
UPDATE ctest SET res = crypt(data, salt);
SELECT res = crypt(data, res) AS "worked"
FROM ctest;

DROP TABLE ctest;