Skip to content

Instantly share code, notes, and snippets.

@hazelement hazelement/user.sql
Created Sep 5, 2018

Embed
What would you like to do?
Postgres
/* create user with password */
CREATE USER xxx WITH ENCRYPTED PASSWORD 'xxxxxxx';
/* set permissions */
GRANT CONNECT ON DATABASE mydb TO xxx;
GRANT USAGE ON SCHEMA public TO xxx;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO xxx;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO xxx;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.