2

I want to create a user that has:

  • has its default privileges revoked when I create it
  • can only perform selects against a given database/schema

Is this possible?

1
  • 2
    Yes, that is possible. Just issue the right GRANTs. Commented Jun 24, 2020 at 15:20

1 Answer 1

0

Please read below mentioned official documentation from Postgres

Official Documentation of REVOKE:

https://www.postgresql.org/docs/9.6/sql-revoke.html

Official Documentation of GRANT:

https://www.postgresql.org/docs/9.6/sql-grant.html

To grant select privilege to schema you need to run following query

GRANT SELECT ON ALL TABLES IN SCHEMA schema_name TO user_name;

For more details read following Post

https://dba.stackexchange.com/questions/91953/grant-access-to-all-tables-of-a-database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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