Skip to content

Instantly share code, notes, and snippets.

@romuloceccon
Last active June 8, 2018 09:12
Show Gist options
  • Save romuloceccon/850d380964d57871c80cfa822846e868 to your computer and use it in GitHub Desktop.
Save romuloceccon/850d380964d57871c80cfa822846e868 to your computer and use it in GitHub Desktop.
$ createdb mydb
$ sudo -u postgres psql mydb
# CREATE ROLE myrole WITH LOGIN PASSWORD 'mypwd';
# GRANT CONNECT ON DATABASE mydb TO myrole;
# GRANT USAGE ON SCHEMA public TO myrole;
# GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO myrole;
# GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO myrole;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment