Created
September 22, 2018 13:24
-
-
Save sadmansh/2f1ea0805b4e18c52d0ee852a30de66a to your computer and use it in GitHub Desktop.
PostgreSQL snippets
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 database | |
CREATE DATABASE databasename; | |
# Create user | |
CREATE USER username WITH ENCRYPTED PASSWORD 'password'; | |
# Add/Change password to existing user | |
ALTER USER username WITH ENCRYPTED PASSWORD 'password'; | |
# Grant database privileges to user | |
GRANT ALL PRIVILEGES ON DATABASE databasename TO username; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment