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.