Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: imchifan(at)163(dot)com, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
Date: 2026-09-20 18:33:09
Message-ID: CAGRkXqTssJ5ttoY_BATULMChBHQAAyO3sPNBMXGnCOws3ANRQQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

> For a newly created sequence, has_sequence_privilege reports that the
owner
> has USAGE, but information_schema.usage_privileges omits that privilege.

I reproduced this locally. The impact looks low to me. It is a view
error, not a permission error, so users see the wrong result in
information_schema but they can still use the sequence.

Patch attached for the acldefault('r') to acldefault('s') fix Tom
described.

0002 adds a regression test next to the has_sequence_privilege tests.
It checks a sequence with no explicit grants, which is the case that
goes through acldefault, and the same sequence after a grant, which
goes through relacl. With 0001 reverted the first query returns zero
rows.

This may needs a catversion bump and backport to 14.
The older version requires manual drop and recreate the view.

Thanks,
Shihao

Attachment Content-Type Size
v1-0002-Add-tests-for-sequence-USAGE-privileges-in-inform.patch application/octet-stream 3.1 KB
v1-0001-Fix-information_schema.usage_privileges-for-seque.patch application/octet-stream 1.5 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2026-09-20 19:18:33 Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
Previous Message Samriddha Kumar Tripathi 2026-09-20 16:18:00 Re: BUG #19704: ispell dictionary accepts trailing junk in numeric COMPOUNDFLAG