First, we need to enable pgcrypto:

CREATE EXTENSION pgcrypto;

Then, we can create a table for storing user credentials:

CREATE TABLE users ( id SERIAL PRIMARY KEY, email TEXT NOT NULL UNIQUE, password TEXT NOT NULL );

When creating a new user, we can use the crypt function to encrypt the password.

INSERT INTO users (email, password) VALUES ( 'johndoe@mail.com', crypt('johnspassword', gen_salt('bf')) );


//


잘 된다.