Created
December 14, 2018 06:12
-
-
Save lemonlatte/18705b80cb0754e43a1eb90f2f5807b4 to your computer and use it in GitHub Desktop.
Create a new database
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
CREATE DATABASE db; | |
CREATE USER user WITH ENCRYPTED PASSWORD 'xxxx-oooo'; | |
\c db; | |
GRANT ALL PRIVILEGES ON DATABASE db TO user; | |
GRANT USAGE ON SCHEMA public TO user ; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO user; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO user; | |
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO user; | |
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO user; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment