4
CREATE EXTENSION pgcrypto;
5
-- ensure consistent test output regardless of the default bytea format
6
SET bytea_output TO escape;
7
-- check for encoding fn's
8
SELECT encode('foo', 'hex');
14
SELECT decode('666f6f', 'hex');
20
-- check error handling
21
select gen_salt('foo');
22
ERROR: gen_salt: Unknown salt algorithm
23
select digest('foo', 'foo');
24
ERROR: Cannot use "foo": No such hash algorithm
25
select hmac('foo', 'foo', 'foo');
26
ERROR: Cannot use "foo": No such hash algorithm
27
select encrypt('foo', 'foo', 'foo');
28
ERROR: Cannot use "foo": No such cipher algorithm