Skip to content

Instantly share code, notes, and snippets.

@echoes341
Created March 30, 2023 09:24
Show Gist options
  • Save echoes341/d03ff8fdb0fcdc13c7fe893ff3460ba0 to your computer and use it in GitHub Desktop.
Save echoes341/d03ff8fdb0fcdc13c7fe893ff3460ba0 to your computer and use it in GitHub Desktop.
PostgreSQL: create new user and give full access to all tables and all new future tables
-- https://phoenixnap.com/kb/postgres-create-user
-- from the user that will create new tables
CREATE USER userb WITH PASSWORD 'sosecure';
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "userb";
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO "userb";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment