@ -554,7 +554,7 @@ CREATE VIEW column_privileges AS
pr_c . prtype ,
pr_c . grantable ,
pr_c . relowner
FROM ( SELECT oid , relname , relnamespace , relowner , ( aclexplode ( relacl ) ) . *
FROM ( SELECT oid , relname , relnamespace , relowner , ( aclexplode ( coalesce ( relacl , acldefault ( ' r ' , relowner ) ) ) ) . *
FROM pg_class
WHERE relkind IN ( ' r ' , ' v ' , ' f ' )
) pr_c ( oid , relname , relnamespace , relowner , grantor , grantee , prtype , grantable ) ,
@ -571,8 +571,8 @@ CREATE VIEW column_privileges AS
pr_a . prtype ,
pr_a . grantable ,
c . relowner
FROM ( SELECT attrelid , attname , ( aclexplode ( attacl ) ) . *
FROM pg_attribute
FROM ( SELECT attrelid , attname , ( aclexplode ( coalesce ( attacl , acldefault ( ' c ' , relowner ) ) ) ) . *
FROM pg_attribute a JOIN pg_class cc ON ( a . attrelid = cc . oid )
WHERE attnum > 0
AND NOT attisdropped
) pr_a ( attrelid , attname , grantor , grantee , prtype , grantable ) ,
@ -1276,7 +1276,7 @@ CREATE VIEW routine_privileges AS
THEN ' YES ' ELSE ' NO ' END AS yes_or_no ) AS is_grantable
FROM (
SELECT oid , proname , proowner , pronamespace , ( aclexplode ( proacl ) ) . * FROM pg_proc
SELECT oid , proname , proowner , pronamespace , ( aclexplode ( coalesce ( proacl , acldefault ( ' f ' , proowner ) ) ) ) . * FROM pg_proc
) p ( oid , proname , proowner , pronamespace , grantor , grantee , prtype , grantable ) ,
pg_namespace n ,
pg_authid u_grantor ,
@ -1797,7 +1797,7 @@ CREATE VIEW table_privileges AS
CAST ( CASE WHEN c . prtype = ' SELECT ' THEN ' YES ' ELSE ' NO ' END AS yes_or_no ) AS with_hierarchy
FROM (
SELECT oid , relname , relnamespace , relkind , relowner , ( aclexplode ( relacl ) ) . * FROM pg_class
SELECT oid , relname , relnamespace , relkind , relowner , ( aclexplode ( coalesce ( relacl , acldefault ( ' r ' , relowner ) ) ) ) . * FROM pg_class
) AS c ( oid , relname , relnamespace , relkind , relowner , grantor , grantee , prtype , grantable ) ,
pg_namespace nc ,
pg_authid u_grantor ,
@ -2043,7 +2043,7 @@ CREATE VIEW udt_privileges AS
THEN ' YES ' ELSE ' NO ' END AS yes_or_no ) AS is_grantable
FROM (
SELECT oid , typname , typnamespace , typtype , typowner , ( aclexplode ( typacl ) ) . * FROM pg_type
SELECT oid , typname , typnamespace , typtype , typowner , ( aclexplode ( coalesce ( typacl , acldefault ( ' T ' , typowner ) ) ) ) . * FROM pg_type
) AS t ( oid , typname , typnamespace , typtype , typowner , grantor , grantee , prtype , grantable ) ,
pg_namespace n ,
pg_authid u_grantor ,
@ -2129,7 +2129,7 @@ CREATE VIEW usage_privileges AS
THEN ' YES ' ELSE ' NO ' END AS yes_or_no ) AS is_grantable
FROM (
SELECT oid , typname , typnamespace , typtype , typowner , ( aclexplode ( typacl ) ) . * FROM pg_type
SELECT oid , typname , typnamespace , typtype , typowner , ( aclexplode ( coalesce ( typacl , acldefault ( ' T ' , typowner ) ) ) ) . * FROM pg_type
) AS t ( oid , typname , typnamespace , typtype , typowner , grantor , grantee , prtype , grantable ) ,
pg_namespace n ,
pg_authid u_grantor ,
@ -2166,7 +2166,7 @@ CREATE VIEW usage_privileges AS
THEN ' YES ' ELSE ' NO ' END AS yes_or_no ) AS is_grantable
FROM (
SELECT fdwname , fdwowner , ( aclexplode ( fdwacl ) ) . * FROM pg_foreign_data_wrapper
SELECT fdwname , fdwowner , ( aclexplode ( coalesce ( fdwacl , acldefault ( ' F ' , fdwowner ) ) ) ) . * FROM pg_foreign_data_wrapper
) AS fdw ( fdwname , fdwowner , grantor , grantee , prtype , grantable ) ,
pg_authid u_grantor ,
(
@ -2200,7 +2200,7 @@ CREATE VIEW usage_privileges AS
THEN ' YES ' ELSE ' NO ' END AS yes_or_no ) AS is_grantable
FROM (
SELECT srvname , srvowner , ( aclexplode ( srvacl ) ) . * FROM pg_foreign_server
SELECT srvname , srvowner , ( aclexplode ( coalesce ( srvacl , acldefault ( ' S ' , srvowner ) ) ) ) . * FROM pg_foreign_server
) AS srv ( srvname , srvowner , grantor , grantee , prtype , grantable ) ,
pg_authid u_grantor ,
(