Re: BUG #19735: `jsonb_object_agg_unique_strict` drops a JSONB `null` value as if it were SQL NULL - Mailing list pgsql-bugs

From shihao zhong
Subject Re: BUG #19735: `jsonb_object_agg_unique_strict` drops a JSONB `null` value as if it were SQL NULL
Date
Msg-id CAGRkXqS7KdfpuBJELU_K-c69REdtJGvgn76p0h9O4mBk=MOSmQ@mail.gmail.com
Whole thread
In response to BUG #19735: `jsonb_object_agg_unique_strict` drops a JSONB `null` value as if it were SQL NULL  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #19735: `jsonb_object_agg_unique_strict` drops a JSONB `null` value as if it were SQL NULL
List pgsql-bugs
Hi,

I can reproduce this on master. The same happens with all the
skip_nulls paths, such as jsonb_object_agg_strict(), and JSON_OBJECT()
and JSON_OBJECTAGG() using ABSENT ON NULL RETURNING jsonb. The jsonb
array versions keep the value, jsonb_agg_strict('null'::jsonb) returns
[null].

Is dropping JSON nulls here intended? I looked at the old threads
where skip_nulls was discussed [1][2], they are only about SQL NULLs.
The docs just say "null".

If people want this changed I can draft a patch.

[1] https://www.google.com/url?q=https://postgr.es/m/CAJA4AWQ_XbSmsNbW226UqNyRLJ%2Bwb%3DiQkQMj77cQyoNkqtf%3D2Q@mail.gmail.com&source=gmail&ust=1791228842559000&sa=E

pgsql-bugs by date:

Previous
From: shihao zhong
Date:
Subject: Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t"
Next
From: Tom Lane
Date:
Subject: Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t"