📅  最后修改于: 2022-03-11 15:04:55.841000             🧑  作者: Mango
CREATE EXTENSION pgcrypto;
INSERT INTO users (email, password) VALUES (
'johndoe@mail.com',
crypt('johnspassword', gen_salt('bf'))
);
SELECT id
FROM users
WHERE email = 'johndoe@mail.com'
AND password = crypt('johnspassword', password);