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 1x8FLe-000000013PD-2M8n for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Sep 2026 11:04:43 +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 1x8FLc-00000006Jj9-21AN for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Sep 2026 11:04:40 +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 1x7vNS-000000050Tf-0uAf for pgsql-bugs@lists.postgresql.org; Sat, 19 Sep 2026 13:45:14 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x7vNN-00000000DZK-1crQ for pgsql-bugs@lists.postgresql.org; Sat, 19 Sep 2026 13:45:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=YBVtXKVWjRsvD1sE2D4+UHcVps1SMbDPxJlzrUnZeNw=; b=NYBGQnTDQkkyO5x+q+iVz8jQmD z2nY6UEEJAbi8SeJe6nzneL18bTk4oD41/G5U6KTwRWQV+9veS2bnECv3m6UdUTsNlQbC+I8bBSMe SZmC/yrNL777AgQK0BWo5oGdQAWK4v3HVjzo5z4Bq41CJwOBeGhh9pVTgjqGmsdhe90x+F/qrqD2a AknLXLalia2QN3huKaNQ2E8+Ab7QsmICm8PBNve8hL5rzYol14YULWJM8BufqtdwlCEA2WzTEQ0D0 71Gk38qo/GB02veMxR3RUCHNAU51iGR50XouDaX2jQ1AHSlTClSEeR/kY58gjBjNg+nnfSPgiNfbh /J511OEA==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x7vNK-000Z3P-0A for pgsql-bugs@lists.postgresql.org; Sat, 19 Sep 2026 13:45:08 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x7vNH-00000001k9m-1agf for pgsql-bugs@lists.postgresql.org; Sat, 19 Sep 2026 13:45:04 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: imchifan@163.com Reply-To: imchifan@163.com, pgsql-bugs@lists.postgresql.org Date: Sat, 19 Sep 2026 13:44:36 +0000 Message-ID: <19703-49d6f1796001a6d7@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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: =20 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=3D' || has_sequence_privilege( current_user, 'bugseer_postgres_00004_seq_acl', 'USAGE'); SELECT 'implicit_view_rows=3D' || count(*) FROM information_schema.usage_privileges WHERE object_schema =3D current_schema AND object_name =3D 'bugseer_postgres_00004_seq_acl' AND object_type =3D 'SEQUENCE' AND grantee =3D current_user AND privilege_type =3D 'USAGE'; GRANT USAGE ON SEQUENCE bugseer_postgres_00004_seq_acl TO CURRENT_USER; SELECT 'explicit_view_rows=3D' || count(*) FROM information_schema.usage_privileges WHERE object_schema =3D current_schema AND object_name =3D 'bugseer_postgres_00004_seq_acl' AND object_type =3D 'SEQUENCE' AND grantee =3D current_user AND privilege_type =3D 'USAGE'; Actual result ------------- implicit_privilege=3Dtrue implicit_view_rows=3D0 GRANT explicit_view_rows=3D1 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.