From 1187b09ddee61ca682faef080c55a81b3bb1d7cc Mon Sep 17 00:00:00 2001 From: Shihao Date: Sun, 20 Sep 2026 14:20:23 -0400 Subject: [PATCH v1 1/2] Fix information_schema.usage_privileges for sequence owners The sequences arm of the view builds the default ACL with acldefault('r', relowner), but sequences use 's'. A relation default ACL has no USAGE bit, so the prtype filter dropped every row and the owner's implicit USAGE privilege never showed up. It only appeared once someone granted USAGE explicitly, which made relacl non null and took acldefault out of the picture. --- src/backend/catalog/information_schema.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql index 49adf66ba9b..ec85ec1e7c8 100644 --- a/src/backend/catalog/information_schema.sql +++ b/src/backend/catalog/information_schema.sql @@ -2386,7 +2386,7 @@ CREATE VIEW usage_privileges AS THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable FROM ( - SELECT oid, relname, relnamespace, relkind, relowner, (aclexplode(coalesce(relacl, acldefault('r', relowner)))).* FROM pg_class + SELECT oid, relname, relnamespace, relkind, relowner, (aclexplode(coalesce(relacl, acldefault('s', relowner)))).* FROM pg_class ) AS c (oid, relname, relnamespace, relkind, relowner, grantor, grantee, prtype, grantable), pg_namespace n, pg_authid u_grantor, -- 2.37.1 (Apple Git-137.1)