Created
January 30, 2018 15:56
-
-
Save mbreese/8ddb5c1071b0d54b965cc5a08a66cdcd to your computer and use it in GitHub Desktop.
Add a new user to Postgres
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE ROLE db_user LOGIN ENCRYPTED PASSWORD 'secret-password' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; | |
CREATE DATABASE db_name WITH OWNER db_user; | |
GRANT ALL PRIVILEGES ON DATABASE db_name TO db_user; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment