Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x8Jnq-000000016ZZ-1U3h for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Sep 2026 15:50:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x8Jnp-00000006lWX-15sI for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Sep 2026 15:50:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x8Jnp-00000006lWP-04eG for pgsql-bugs@lists.postgresql.org; Sun, 20 Sep 2026 15:50:05 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x8Jnm-00000000NcD-2Ze5 for pgsql-bugs@lists.postgresql.org; Sun, 20 Sep 2026 15:50:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68KFnjbD362685; Sun, 20 Sep 2026 11:49:46 -0400 From: Tom Lane To: imchifan@163.com cc: Peter Eisentraut , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege In-reply-to: <19703-49d6f1796001a6d7@postgresql.org> References: <19703-49d6f1796001a6d7@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 19 Sep 2026 13:44:36 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <362683.1789919385.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 20 Sep 2026 11:49:45 -0400 Message-ID: <362684.1789919385@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > For a newly created sequence, has_sequence_privilege reports that the ow= ner > 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, (aclexpl= ode(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