agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: imchifan@163.com
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
Date: Sun, 20 Sep 2026 11:49:45 -0400
Message-ID: <362684.1789919385@sss.pgh.pa.us> (raw)
In-Reply-To: <19703-49d6f1796001a6d7@postgresql.org>
References: <19703-49d6f1796001a6d7@postgresql.org>

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






view thread (5+ messages)  latest in thread

Message-ID: <362684.1789919385@sss.pgh.pa.us>
Permalink:  ../362684.1789919385@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/362684.1789919385@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, imchifan@163.com, peter@eisentraut.org, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
  In-Reply-To: <362684.1789919385@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox