Last active
September 30, 2022 11:43
-
-
Save Teebor-Choka/2b698d9ce4086e7fb944c3169b548059 to your computer and use it in GitHub Desktop.
Create a read-only user in postgresql
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 ROLE test_ro_access; | |
| GRANT CONNECT ON DATABASE test TO test_ro_access; | |
| GRANT USAGE ON SCHEMA public TO test_ro_access; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO test_ro_access; | |
| CREATE USER test_read_user WITH PASSWORD 'passw0rd'; | |
| GRANT test_ro_access TO test_read_user; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment