Created
October 7, 2018 18:48
-
-
Save samueltc/4d63d10eacc78052e97c0f29cc141d20 to your computer and use it in GitHub Desktop.
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
psql postgres | |
CREATE ROLE new_user WITH PASSWORD 'big secure pass'; | |
psql new_db | |
GRANT CONNECT ON DATABASE new_db TO new_user; | |
GRANT USAGE ON SCHEMA public TO new_user; | |
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO new_user; | |
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO new_user; | |
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO new_user; | |
GRANT CONNECT ON DATABASE new_db TO new_user; | |
ALTER ROLE new_user WITH LOGIN; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment