Created
February 25, 2019 16:55
-
-
Save secilreel/f4d6fcd6b0833c80535a685ba4968679 to your computer and use it in GitHub Desktop.
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
The receptionists at Dunder Mifflin would like to create and manage their own database of visitors to the office. Create two roles, erin and erin_admin. Make the erin_admin role a superuser. Create a database named visitors with erin_admin as the owner. | |
psql postgres | |
postgres=# CREATE ROLE erin; | |
postgres=# CREATE ROLE erin_admin WITH SUPERUSER; | |
postgres=# CREATE DATABASE visitors; | |
postgres=# ALTER DATABASE visitors OWNER TO erin_admin; | |
postgres=# \q | |
psql visitors | |
visitors=# \du | |
List of roles | |
Role name | Attributes | Member of | |
------------+------------------------------------------------------------+----------- | |
erin | Cannot login | {} | |
erin_admin | Superuser, Cannot login | {} | |
postgres | Superuser | {} | |
secilreel | Superuser, Create role, Create DB, Replication, Bypass RLS | {} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment