Name: | routine_privileges |
Owner: | postgres |
Has rules: | |
Has Triggers: | |
Comment: |
Name | Type | Length | |
|
grantor | sql_identifier | -1 |
|
grantee | sql_identifier | -1 |
|
specific_catalog | sql_identifier | -1 |
|
specific_schema | sql_identifier | -1 |
|
specific_name | sql_identifier | -1 |
|
routine_catalog | sql_identifier | -1 |
|
routine_schema | sql_identifier | -1 |
|
routine_name | sql_identifier | -1 |
|
privilege_type | character_data | -1 |
|
is_grantable | character_data | -1 |
CREATE VIEW routine_privileges AS
SELECT (u_grantor.rolname)::sql_identifier AS grantor, (grantee.rolname)::sql_identifier AS grantee, (current_database())::sql_identifier AS specific_catalog, (n.nspname)::sql_identifier AS specific_schema, ((((p.proname)::text || '_'::text) || (p.oid)::text))::sql_identifier AS specific_name, (current_database())::sql_identifier AS routine_catalog, (n.nspname)::sql_identifier AS routine_schema, (p.proname)::sql_identifier AS routine_name, ('EXECUTE'::character varying)::character_data AS privilege_type, (CASE WHEN aclcontains(p.proacl, makeaclitem(grantee.oid, u_grantor.oid, 'EXECUTE'::text, true)) THEN 'YES'::text ELSE 'NO'::text END)::character_data AS is_grantable FROM pg_proc p, pg_namespace n, pg_authid u_grantor, (SELECT pg_authid.oid, pg_authid.rolname FROM pg_authid UNION ALL SELECT (0)::oid AS oid, 'PUBLIC') grantee(oid, rolname) WHERE (((p.pronamespace = n.oid) AND aclcontains(p.proacl, makeaclitem(grantee.oid, u_grantor.oid, 'EXECUTE'::text, false))) AND ((pg_has_role(u_grantor.oid, 'USAGE'::text) OR pg_has_role(grantee.oid, 'USAGE'::text)) OR (grantee.rolname = 'PUBLIC'::name)));
ALTER TABLE information_schema.routine_privileges OWNER TO postgres;
See Also
List of views