agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: imchifan@163.com
Subject: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
Date: Sat, 19 Sep 2026 13:44:36 +0000
Message-ID: <19703-49d6f1796001a6d7@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 19703
Logged by: Qifan Liu
Email address: imchifan@163.com
PostgreSQL version: 18.6
Operating system: Linux/amd64
Description:
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.
Steps to reproduce
------------------
\pset tuples_only on
\pset format unaligned
DROP SEQUENCE IF EXISTS bugseer_postgres_00004_seq_acl;
CREATE SEQUENCE bugseer_postgres_00004_seq_acl;
SELECT 'implicit_privilege=' || has_sequence_privilege(
current_user, 'bugseer_postgres_00004_seq_acl', 'USAGE');
SELECT 'implicit_view_rows=' || count(*)
FROM information_schema.usage_privileges
WHERE object_schema = current_schema
AND object_name = 'bugseer_postgres_00004_seq_acl'
AND object_type = 'SEQUENCE'
AND grantee = current_user
AND privilege_type = 'USAGE';
GRANT USAGE ON SEQUENCE bugseer_postgres_00004_seq_acl TO CURRENT_USER;
SELECT 'explicit_view_rows=' || count(*)
FROM information_schema.usage_privileges
WHERE object_schema = current_schema
AND object_name = 'bugseer_postgres_00004_seq_acl'
AND object_type = 'SEQUENCE'
AND grantee = current_user
AND privilege_type = 'USAGE';
Actual result
-------------
implicit_privilege=true
implicit_view_rows=0
GRANT
explicit_view_rows=1
Expected result
---------------
information_schema.usage_privileges should report one owner USAGE row before
the redundant explicit grant, and the row count should remain one afterward.
Additional information
----------------------
The issue was reproduced on PostgreSQL 20devel, PostgreSQL 18.6, and
PostgreSQL 17.11.
view thread (5+ messages) latest in thread
Message-ID: <19703-49d6f1796001a6d7@postgresql.org>
Permalink: ../19703-49d6f1796001a6d7@postgresql.org/
Also on: postgresql.org/message-id/19703-49d6f1796001a6d7@postgresql.org
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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, imchifan@163.com
Subject: Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
In-Reply-To: <19703-49d6f1796001a6d7@postgresql.org>
* 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