PG Bug reporting form <noreply@postgresql.org> writes:
> For a newly created sequence, has_sequence_privilege reports that the owner
> has USAGE, but information_schema.usage_privileges omits that privilege. The
> view reports the owner privilege only after the same USAGE privilege is
> redundantly granted explicitly.
I think the problem is that the "sequences" arm of usage_privileges
writes
SELECT oid, relname, relnamespace, relkind, relowner, (aclexplode(coalesce(relacl, acldefault('r',
relowner)))).*FROM pg_class
but the acldefault code for sequences is 's' not 'r', so the wrong
set of default ACL bits is injected. We would see a bunch of
obviously-inapplicable privileges reported, except that the query
then applies a filter:
AND c.prtype IN ('USAGE')
and we end up reporting nothing.
This appears to go clear back to 82e83f46a.
regards, tom lane