-
-
Save v1nc3ntlaw/e1cf39e3f54741a47c1412a129f1f57c to your computer and use it in GitHub Desktop.
πβπ¨ PostgreSQL: Create readonly user
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 user (e.g. metabase) | |
create user metabase with encrypted password 'password'; | |
-- allow user connect to db | |
grant connect on database site to metabase; | |
-- allow user access to schema | |
grant usage on schema public to metabase; | |
-- grant select on existing tables | |
grant select on all tables in schema public to metabase; | |
-- allow user to access all tables in schema | |
alter default privileges in schema public | |
grant select on tables to metabase; | |
-- limit number of connections | |
-- alter role metabase with connection limit 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment