Skip to content

Instantly share code, notes, and snippets.

@njmube
Forked from martinusso/grant.sql
Created February 24, 2020 03:17
Show Gist options
  • Save njmube/d22af8d6df17d53af76f83cda766a924 to your computer and use it in GitHub Desktop.
Save njmube/d22af8d6df17d53af76f83cda766a924 to your computer and use it in GitHub Desktop.
grant postgres
GRANT CONNECT ON DATABASE postgres TO role_name;
GRANT CREATE ON DATABASE postgres TO role_name;
GRANT USAGE ON SCHEMA schema_name TO role_name;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA schema_name TO role_name;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA schema_name TO role_name;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO role_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment