mar*_*kus 8 sql postgresql sequence grant
要查询授予表的GRANTS,我可以使用如下查询:
SELECT grantee, privilege_type
FROM information_schema.role_table_grants
WHERE table_name='mytable'
Run Code Online (Sandbox Code Playgroud)
(请参阅我在这里的旧问题:查询postgres中的表格授予)
但是我如何查询GRANTS被授予一个序列?
我查看了源代码,我找不到任何通过information_schema表公开序列ACL的地方.(不过我可能会错过一些东西.)
PostgreSQL确实公开了系统目录pg_class中序列的ACL.
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'
);
Run Code Online (Sandbox Code Playgroud)
就information_schema和标准SQL序列而言,PostgreSQL不支持它们.
select feature_name, is_supported
from information_schema.sql_features
where feature_name = 'Sequence generator support';
Run Code Online (Sandbox Code Playgroud)
PostgreSQL在这方面是不合格的,因为它暴露了information_schema.sequences而没有为'Sequence generator support'返回"YES".(这是一个观察,而不是对PostgreSQL的批评.)
但是,说了这么多,我在2003 SQL标准中找不到任何暴露这些特权的东西.在ROLE_TABLE_GRANTS视图的定义中很容易找到PRIVILEGE_TYPE,但据我所知,标准中的序列没有类似的东西.
归档时间: |
|
查看次数: |
4492 次 |
最近记录: |