Last active
April 18, 2023 13:49
-
-
Save obax/e78ca34af7fd08e8e49da3eab9f3ff25 to your computer and use it in GitHub Desktop.
database-users
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
DO | |
$do$ | |
BEGIN | |
IF EXISTS ( | |
SELECT FROM pg_catalog.pg_roles | |
WHERE rolname = 'eos_app_rw') THEN | |
RAISE NOTICE 'Role "eos_app_rw" already exists. Skipping.'; | |
ELSE | |
CREATE USER eos_app_rw; | |
END IF; | |
END | |
$do$; |
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
GRANT USAGE ON SCHEMA public TO eos_app_rw; | |
GRANT INSERT, UPDATE, DELETE, SELECT ON ALL TABLES IN SCHEMA public TO eos_app_rw; | |
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO eos_app_rw; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment