Created
July 30, 2019 14:14
-
-
Save okram999/32ebff98d1fcb97b53edf73a99c0d36a to your computer and use it in GitHub Desktop.
Adding a user or granting access
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 new user: CREATE USER <userid> WITH PASSWORD <password>; | |
User should change password after login: ALTER ROLE your_userid WITH PASSWORD 'new_password'; | |
Create a role: CREATE ROLE < Role Name> | |
Grant PRIVILEGES to Role: GRANT SELECT ON all tables in schema public to <role_name> | |
Assign role to user: GRANT <Role Name> TO <User Id>; | |
Revoke permissions: REVOKE <userId> FROM <role name>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment