Skip to content

Instantly share code, notes, and snippets.

@jittuu
Last active July 7, 2022 06:59
Show Gist options
  • Save jittuu/c7c72875e3e14dc0c7658b6de14929f6 to your computer and use it in GitHub Desktop.
Save jittuu/c7c72875e3e14dc0c7658b6de14929f6 to your computer and use it in GitHub Desktop.
Create APP CRUD user in Postgres
CREATE ROLE crud_user LOGIN PASSWORD 'thisissecretpassword';
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO crud_user;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO crud_user;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO crud_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT USAGE, SELECT ON SEQUENCES TO crud_user;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment