Created
April 15, 2020 09:43
-
-
Save ob1-sc/08236f8cca765a5ad5c3c67da0595ef0 to your computer and use it in GitHub Desktop.
Postgres user and db creation
This file contains hidden or 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
REVOKE CREATE ON SCHEMA public FROM PUBLIC; | |
CREATE ROLE <db_owner> WITH LOGIN PASSWORD '<db_owner_password>'; | |
CREATE DATABASE <db_name> WITH OWNER=<db_owner>; | |
REVOKE ALL ON DATABASE <db_name> FROM public; | |
GRANT ALL ON DATABASE <db_name> TO <db_owner>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment