~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/sql/crypt-des.sql

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- crypt() and gen_salt(): crypt-des
 
3
--
 
4
 
 
5
SELECT crypt('', 'NB');
 
6
 
 
7
SELECT crypt('foox', 'NB');
 
8
 
 
9
CREATE TABLE ctest (data text, res text, salt text);
 
10
INSERT INTO ctest VALUES ('password', '', '');
 
11
 
 
12
UPDATE ctest SET salt = gen_salt('des');
 
13
UPDATE ctest SET res = crypt(data, salt);
 
14
SELECT res = crypt(data, res) AS "worked"
 
15
FROM ctest;
 
16
 
 
17
DROP TABLE ctest;
 
18