0

I want to grant user foo_user read only access to schema bar_schema.

I executed the following commands

postgres=> GRANT SELECT ON ALL TABLES IN SCHEMA bar_schema TO foo_user;
GRANT
postgres=> ALTER DEFAULT PRIVILEGES IN SCHEMA bar_schema GRANT SELECT ON TABLES TO foo_user;
ALTER DEFAULT PRIVILEGES

How can I now validate that foo_user had indeed RO access to bar_schema ?

1

As a user with the appropriate permissions, you can

SET ROLE foo_user;

to become that role and then try to access the tables.

You forgot the following privilege:

GRANT USAGE ON SCHEMA bar_schema TO foo_user;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.