Has anyone used `PGP_SYM_ENCRYPT` or have any exam...
# sql
c
Has anyone used
PGP_SYM_ENCRYPT
or have any examples?
I was able to figure it out for anyone that wants to encrypt things here is what I did for a simple example
Copy code
-- CREATE TABLE test (id SERIAL PRIMARY KEY,
--                     email TEXT NOT NULL UNIQUE,
--                     password TEXT NOT NULL);

-- INSERT INTO test (email, password)
-- VALUES ('test@mail.com', pgp_sym_encrypt('password', 'KEY'));

SELECT *, pgp_sym_decrypt(password::bytea, 'KEY') as password
FROM test