> On Wed, Oct 07, 2026 at 10:30:48PM -0400, shihao zhong wrote:
> Hi Dmitry,
>
> I agree the docs should say which nulls are meant.
>
> I am not sure it was intended though. The jsonb array functions keep
> a JSON null
This is the one difference from most of the other functions,
jsonb_agg_transfn_worker for some reason does not set skip_nulls, even
though it has absent_on_null available. jsonb_object_agg_transfn_worker
does it like:
result->parseState->skip_nulls = absent_on_null;
I presume jsonb_agg_transfn_worker have to be unified with the others.
> , and JSON_OBJECT() drops the key only with RETURNING jsonb:
From what I see it drops nulls due to ABSENT ON NULL, e.g. ABSENT ON
NULL WITHOUT UNIQUE KEYS will do the same. Otherwise ditto,
jsonb_build_object_worker sets skip_nulls like above if ABSENT ON NULL
is specified.
> Skipping only SQL NULLs needs no check per element in jsonb, the
> caller knows which values it skipped.
I mean to check per every element in the to be aggregated set.