Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
psql postgres
CREATE ROLE new_user WITH PASSWORD 'big secure pass';
psql new_db
GRANT CONNECT ON DATABASE new_db TO new_user;
GRANT USAGE ON SCHEMA public TO new_user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO new_user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO new_user;
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO new_user;
GRANT CONNECT ON DATABASE new_db TO new_user;
ALTER ROLE new_user WITH LOGIN;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment