SELECT X.object_type,
X.object_schema,
X.object_name,
X.permissions,
X.grantor,
X.owner,
X."grant_sql (for permissions that have '*')"
FROM ( SELECT 1 AS ordinal,
g.object_schema,
g.object_name,
g.object_type,
CASE WHEN (g.privileges_description = 'USAGE'::varchar(5)) THEN (g.privileges_description || ' (READONLY access) '::varchar(19)) WHEN (g.privileges_description ~~ '%CREATE%'::varchar(8)) THEN (g.privileges_description || ' (can read, create & drop tables) '::varchar(34)) ELSE NULL END AS permissions,
g.grantor,
s.schema_owner AS owner,
CASE WHEN (g.privileges_description ~~ '%*%'::varchar(3)) THEN (('grant <INSERT, SELECT, UPDATE, DELETE, REFERENCES> on '::varchar(54) || g.object_name) || ' to <user_name> ; '::varchar(18)) ELSE NULL END AS "grant_sql (for permissions that have '*')"
FROM (v_catalog.grants g JOIN v_catalog.schemata s ON ((g.object_name = s.schema_name)))
WHERE (g.object_type = 'SCHEMA'::varchar(6)) UNION SELECT 2 AS ordinal,
g.object_schema,
((t.table_schema || '.'::varchar(1)) || t.table_name) AS object_name,
g.object_type,
g.privileges_description AS permissions,
g.grantor,
t.owner_name AS owner,
CASE WHEN (g.privileges_description ~~ '%*%'::varchar(3)) THEN (('grant <usage, create> on '::varchar(25) || g.object_name) || ' to <user_name> ; '::varchar(18)) ELSE NULL END AS "grant_sql (for permissions that have '*')"
FROM (v_catalog.grants g JOIN v_catalog.tables t ON (((g.object_schema = t.table_schema) AND (g.object_name = t.table_name))))
WHERE (g.object_type = 'TABLE'::varchar(5))) X
ORDER BY X.ordinal,
X.object_name;
ALL_TABLES 显示表和视图。TABLES 仅显示表格:
还有一个名为视图的系统表:
用户可以从表、all_tables 和视图中进行选择,以查看他对哪些表和视图具有权限。我相信我是从 http://www.vertica-forums.com/viewtopic.php?t=726得到的
这是我用作 DBADMIN 的工具来总结权限: