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: theshallow27@gmail.com
Subject: BUG #19735: `jsonb_object_agg_unique_strict` drops a JSONB `null` value as if it were SQL NULL
Date: Fri, 02 Oct 2026 22:03:41 +0000
Message-ID: <19735-488819822dc79bca@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 19735
Logged by: Shallow
Email address: theshallow27@gmail.com
PostgreSQL version: 18.6
Operating system: Linux
Description:
The strict JSONB object aggregate omits a non-SQL-NULL `jsonb` datum whose
JSON
value is `null`. The corresponding non-strict JSONB aggregate and strict
JSON
aggregate preserve the key with a JSON null value. The aggregate
documentation
says that strict mode skips a value when the value is NULL; a JSONB `null`
value
is distinct from SQL NULL.
**Reproduction:**
```sql
SELECT jsonb_object_agg_unique_strict('a', 'null'::jsonb)::text,
jsonb_object_agg_unique('a', 'null'::jsonb)::text,
json_object_agg_unique_strict('a', 'null'::jsonb)::text;
```
**Actual result:**
```text
{} | {"a": null} | { "a" : null }
```
**Expected result:** The strict JSONB aggregate should skip SQL NULL values
but
preserve a JSONB datum containing JSON `null`, consistent with the other two
aggregate results.
Message-ID: <19735-488819822dc79bca@postgresql.org>
Permalink: ../19735-488819822dc79bca@postgresql.org/
Also on: postgresql.org/message-id/19735-488819822dc79bca@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 #19735: `jsonb_object_agg_unique_strict` drops a JSONB `null` value as if it were SQL NULL
In-Reply-To: <19735-488819822dc79bca@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