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 1xD78E-00000000K6D-1AwI for pgsql-bugs@arkaria.postgresql.org; Sat, 03 Oct 2026 21:18:58 +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 1xD78D-00000003FFB-1M7e for pgsql-bugs@arkaria.postgresql.org; Sat, 03 Oct 2026 21:18:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xCltG-00000001Tyl-3dUi for pgsql-bugs@lists.postgresql.org; Fri, 02 Oct 2026 22:38:06 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xCltE-000000004rQ-3dx2 for pgsql-bugs@lists.postgresql.org; Fri, 02 Oct 2026 22:38:06 +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=/+aj1O71F488T4jvuVnSx2MMcL4lhKFyPmL6LT5GeHs=; b=UEdbMA45Zex7BSQDOA4Qd25ruv BynwbQ2tN+ld87cazZ12sW9hvyVZS4qd1vVBXaarnDhHLUsVd1gHWe4l/lQOrrt9lLpGi0yrbejhh hGu3In62S4QDWry4SchdjQ/QB6+EQZYZkpNEB4GSJYKsOJf4yeeB4EuGHoe4mM8Gus6OKUhKUhTIs q95a6+XYlwMg1K9m+Gf4wm/SBLDYE0+pmHEgs1wkwtLt1yNNVIaXjeycNYrZhJeqT1cBGdJkBdhs7 jhRnNSHXEcdmW+UKR2i+7bGR3lM1fsJJEV1vsZBQl2D6QOpcfn1qSnH4822qHzNQEvgdi1YcYpOwQ oCXIVg8g==; 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.98.2) (envelope-from ) id 1xCltE-00000000JBu-1qlA for pgsql-bugs@lists.postgresql.org; Fri, 02 Oct 2026 22:38:04 +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 1xCltD-00000000sf8-16Xp for pgsql-bugs@lists.postgresql.org; Fri, 02 Oct 2026 22:38:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19740: `has_language_privilege` returns TRUE for a nonexistent language OID when the user is a superuser To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: theshallow27@gmail.com Reply-To: theshallow27@gmail.com, pgsql-bugs@lists.postgresql.org Date: Fri, 02 Oct 2026 22:38:00 +0000 Message-ID: <19740-677922f8a0cc921c@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: 19740 Logged by: Shallow Email address: theshallow27@gmail.com PostgreSQL version: 18.6 Operating system: Linux Description: =20 For a nonexistent language OID, the implicit-current-user form returns TRUE when the current user is a superuser. An explicit non-superuser role returns NULL for the same missing OID. This makes the result depend on the role's superuser status even though the referenced language does not exist. **Reproduction:** Run as the default `postgres` superuser: ```sql SELECT NOT EXISTS (SELECT FROM pg_language WHERE oid =3D 0), has_language_privilege(0::oid, 'USAGE'), has_language_privilege('pg_monitor', 0::oid, 'USAGE'); ``` **Actual result:** `true | true | NULL`. **Expected result:** The privilege inquiry should return NULL for the missing language OID in both forms, matching the function's missing-object handling for non-superuser roles.