PostgreSQL revoking permissions from pg_catalog tables

Is there a way to revoke access rights to directory objects (e.g. information_schema) and PostgreSQL (i.e. pg_catalog)? I tried several things and cleaned the net. I was not lucky. The only thing I read is partially useful, since I may not want to remove the β€œpublic” from the system tables if user-defined functions rely on an object in one of these schemes. The commands below are a small snapshot of what I did not work except for one table.

REVOKE ALL PRIVILEGES ON SCHEMA pg_catalog FROM PUBLIC; -- didn't work
REVOKE ALL PRIVILEGES ON SCHEMA pg_catalog FROM public; -- didn't work
REVOKE ALL PRIVILEGES ON SCHEMA pg_catalog FROM user1; -- didn't work
REVOKE SELECT ON pg_catalog.pg_roles FROM user1; -- worked
REVOKE SELECT ON pg_catalog.pg_database FROM user1;  -- didn't work

REVOKE ALL PRIVILEGES ON SCHEMA pg_catalog FROM g_users; -- didn't work
REVOKE SELECT ON pg_catalog.pg_database FROM g_users;  -- didn't work

Any ideas? Or is it simply impossible? Thanks...

Leslie

+4
source share
2 answers

let me help you about this:

  • 1st: pg_catalog postgres, , : pg_catalog

  • 2nd: , , GRANT/REVOKE. GRANT/REVOKE , . , : \c [db] , : [db] = >

  • 3rd: pg_catalog SELECT PUBLIC: pg_catalog. , REVOKE SELECT FROM PUBLIC, GRANT SELECT :

    REVOKE SELECT ON ALL TABLES SCHEMA pg_catalog FROM PUBLIC;

    GRANT SELECT ON TABLE [] TO [];

    : pg_class pg_namespace.

:)

+5

, , PostgreSQL .

pg_catalog ( REVOKE), / SELECT - .

REVOKE , ( CREATE SCHEMA AUTHORIZATION username).

- GRANT 'ed public, - REVOKE ... FROM public.

HTH, , , .

+2