Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege - Mailing list pgsql-bugs

From shihao zhong
Subject Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
Date
Msg-id CAGRkXqTssJ5ttoY_BATULMChBHQAAyO3sPNBMXGnCOws3ANRQQ@mail.gmail.com
Whole thread
In response to Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
List 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

pgsql-bugs by date:

Previous
From: Samriddha Kumar Tripathi
Date:
Subject: Re: BUG #19704: ispell dictionary accepts trailing junk in numeric COMPOUNDFLAG
Next
From: Tom Lane
Date:
Subject: Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege