GRANTS query provided by postgres sequence

For the GRANTS query provided for the table, I can use a query such as:

SELECT grantee, privilege_type 
FROM information_schema.role_table_grants 
WHERE table_name='mytable'

(see my old question here: Queries for a table in postgres )

But how do I request GRANTS converted to a sequence?

+8
source share
2 answers

I looked through the source code, and I cannot find the place that the ACL provides for the sequences through the information_schema tables. (I could have missed something).

PostgreSQL sets the ACL for sequences in the pg_class system directory.

SELECT relname, relacl
FROM pg_class
WHERE relkind = 'S'
  AND relacl is not null
  AND relnamespace IN (
      SELECT oid
      FROM pg_namespace
      WHERE nspname NOT LIKE 'pg_%'
        AND nspname != 'information_schema'
);

_ ​​ SQL-, PostgreSQL .

select feature_name, is_supported 
from information_schema.sql_features
where feature_name = 'Sequence generator support';

PostgreSQL , _, "" " ". ( , PostgreSQL.)

, , SQL 2003, . PRIVILEGE_TYPE ROLE_TABLE_GRANTS, , , .

+7
GRANT USAGE, SELECT ON SEQUENCE sequence_name TO user_role_name;

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

0

All Articles