-
-
Save dexter0201/fe9ef00cf90b4728cc5dc96e64fba845 to your computer and use it in GitHub Desktop.
Revisions
-
Francesco Latini revised this gist
Apr 8, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,7 @@ CREATE ROLE postgres_ro_group; -- Grant access to existing tables GRANT USAGE ON SCHEMA public TO postgres_ro_group; GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group; GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO postgres_ro_group; -- Grant access to future tables ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO postgres_ro_group; -
Francesco Latini revised this gist
Sep 27, 2017 . 2 changed files with 25 additions and 13 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ -- -- Read only -- -- Create a group CREATE ROLE postgres_ro_group; -- Grant access to existing tables GRANT USAGE ON SCHEMA public TO postgres_ro_group; GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group; -- Grant access to future tables ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO postgres_ro_group; -- Create a final user with password CREATE USER postgres_ro WITH PASSWORD 'secret'; GRANT postgres_ro_group TO postgres_ro; -- -- Superuser -- -- Create a final user with password CREATE USER postgres_adm WITH PASSWORD 'secret'; GRANT rds_superuser to postgres_adm; -
oinopion created this gist
Oct 5, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ -- Create a group CREATE ROLE readaccess; -- Grant access to existing tables GRANT USAGE ON SCHEMA public TO readaccess; GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; -- Grant access to future tables ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; -- Create a final user with password CREATE USER tomek WITH PASSWORD 'secret'; GRANT readaccess TO tomek;