How to remove access of tables in pg_catalog for a user?

157 views Asked by At

I am trying to create a view for the prod table for a client where he must only have access to views.

I was able to restrict the user to have access to views and not to the table. But in postgres there is a concept of system catalog, where there are some metadata stored which I don't want to give access to the user.

I found the command to restrict pg_catalog tables by REVOKE select ON ALL TABLES IN SCHEMA pg_catalog FROM PUBLIC;

My our DB is in AWS RDS and I cant run this query, as the user must be superuser to run this.

I have tried below as well, but they did not work.
REVOKE ALL PRIVILEGES ON SCHEMA pg_catalog FROM user;

REVOKE ALL PRIVILEGES on table pg_roles FROM PUBLIC;

0

There are 0 answers