~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/expected/crypt-md5.out

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- crypt() and gen_salt(): md5
 
3
--
 
4
SELECT crypt('', '$1$Szzz0yzz');
 
5
               crypt                
 
6
------------------------------------
 
7
 $1$Szzz0yzz$To38XrR3BsbXQW2ZpfKjF1
 
8
(1 row)
 
9
 
 
10
SELECT crypt('foox', '$1$Szzz0yzz');
 
11
               crypt                
 
12
------------------------------------
 
13
 $1$Szzz0yzz$IYL49cd3t9bllsA7Jmz1M1
 
14
(1 row)
 
15
 
 
16
CREATE TABLE ctest (data text, res text, salt text);
 
17
INSERT INTO ctest VALUES ('password', '', '');
 
18
UPDATE ctest SET salt = gen_salt('md5');
 
19
UPDATE ctest SET res = crypt(data, salt);
 
20
SELECT res = crypt(data, res) AS "worked"
 
21
FROM ctest;
 
22
 worked 
 
23
--------
 
24
 t
 
25
(1 row)
 
26
 
 
27
DROP TABLE ctest;