alter database DB_NAME owner to USER_NAME;
CREATE USER user_name WITH PASSWORD 'user_password';
ALTER DATABASE db_name OWNER TO user_name;
GRANT ALL PRIVILEGES ON DATABASE db_name TO user_name;
\c db_name
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA PUBLIC TO user_name;