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

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: imchifan(at)163(dot)com
Subject: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege
Date: 2026-09-19 13:44:36
Message-ID: 19703-49d6f1796001a6d7@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19703
Logged by: Qifan Liu
Email address: imchifan(at)163(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2026-09-19 13:51:31 BUG #19704: ispell dictionary accepts trailing junk in numeric COMPOUNDFLAG
Previous Message PG Bug reporting form 2026-09-19 11:15:48 BUG #19702: decode() accepts Base64 payload after terminal padding