agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: theshallow27@gmail.com
Subject: BUG #19740: `has_language_privilege` returns TRUE for a nonexistent language OID when the user is a superuser
Date: Fri, 02 Oct 2026 22:38:00 +0000
Message-ID: <19740-677922f8a0cc921c@postgresql.org> (raw)

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:        

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 = 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.








view thread (2+ messages)  latest in thread

Message-ID: <19740-677922f8a0cc921c@postgresql.org>
Permalink:  ../19740-677922f8a0cc921c@postgresql.org/
Also on:    postgresql.org/message-id/19740-677922f8a0cc921c@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, theshallow27@gmail.com
  Subject: Re: BUG #19740: `has_language_privilege` returns TRUE for a nonexistent language OID when the user is a superuser
  In-Reply-To: <19740-677922f8a0cc921c@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