diff options
Diffstat (limited to 'contrib/pgcrypto/sql/crypt-blowfish.sql')
| -rw-r--r-- | contrib/pgcrypto/sql/crypt-blowfish.sql | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/contrib/pgcrypto/sql/crypt-blowfish.sql b/contrib/pgcrypto/sql/crypt-blowfish.sql index 6b82fdff63..5128675e0c 100644 --- a/contrib/pgcrypto/sql/crypt-blowfish.sql +++ b/contrib/pgcrypto/sql/crypt-blowfish.sql @@ -2,16 +2,19 @@ -- crypt() and gen_salt(): bcrypt -- -select crypt('', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O'); +SET autocommit TO 'on'; -select crypt('foox', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O'); +SELECT crypt('', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O'); -create table ctest (data text, res text, salt text); -insert into ctest values ('password', '', ''); +SELECT crypt('foox', '$2a$06$RQiOJ.3ELirrXwxIZY8q0O'); -update ctest set salt = gen_salt('bf', 8); -update ctest set res = crypt(data, salt); -select res = crypt(data, res) as "worked" from ctest; +CREATE TABLE ctest (data text, res text, salt text); +INSERT INTO ctest VALUES ('password', '', ''); -drop table ctest; +UPDATE ctest SET salt = gen_salt('bf', 8); +UPDATE ctest SET res = crypt(data, salt); +SELECT res = crypt(data, res) AS "worked" +FROM ctest; + +DROP TABLE ctest; |
