Last active
June 17, 2020 20:14
-
-
Save rponte/f85a4269f3fd2f3a8373b3306f22fe3c to your computer and use it in GitHub Desktop.
PostgreSQL: Creating a new user and 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 the database user | |
| CREATE USER rponte WITH PASSWORD '123'; | |
| -- Create the database | |
| CREATE DATABASE mydb WITH OWNER = rponte | |
| ENCODING = 'UTF8' | |
| LC_CTYPE = 'en_US.UTF-8' | |
| LC_COLLATE = 'en_US.UTF-8' | |
| TEMPLATE = template0; | |
| -- Grant permissions for the created user | |
| GRANT ALL PRIVILEGES ON DATABASE mydb TO rponte; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment