Reputation: 195
I am trying to grant permissions to a user within a role group, where are the steps that I did:
grant read_only to myuser
grant select on all tables in schema public to read_only
alter default priviliges in schema public grant select on tables to read_only
after all the steps above, when I use myuser
to query the tables, I got 'permission denied'. Anything I missed here?
Upvotes: 1
Views: 1573
Reputation: 776
Altering default privileges only affects new tables. You will want to grant the privileges on all existing tables by issuing the below in order for you to have permissions.
GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only;
Upvotes: 1