Amazon Redshift: show permissions

From wikieduonline
Revision as of 10:53, 12 November 2021 by Welcome (talk | contribs) (Created page with " SELECT u.usename, s.schemaname, has_schema_privilege(u.usename,s.schemaname,'create') AS user_has_select_permission, has_schema_privilege(u.usename,s.sche...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
SELECT
    u.usename,
    s.schemaname,
    has_schema_privilege(u.usename,s.schemaname,'create') AS user_has_select_permission,
    has_schema_privilege(u.usename,s.schemaname,'usage') AS user_has_usage_permission
FROM
    pg_user u
CROSS JOIN
    (SELECT DISTINCT schemaname FROM pg_tables) s
WHERE
    u.usename = 'myUserName'
    AND s.schemaname = 'mySchemaName'
;

See also

Advertising: