Steps:
create role:
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 user with password:
CREATE USER grafana WITH PASSWORD 'secretpass@dev';
grant access to user:
GRANT readaccess TO grafana;
Top comments (0)