Re: BUG #19736: `JSON_OBJECT ... ABSENT ON NULL` accepts invalid keys when the value is NULL

From: QQ Mail <781408517(at)qq(dot)com>
To: dudwo990413(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19736: `JSON_OBJECT ... ABSENT ON NULL` accepts invalid keys when the value is NULL
Date: 2026-10-12 06:35:25
Message-ID: tencent_BCD8AC02BF4A6B19A64CB09D718CBDE57E0A@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hi,

Your patch covers the non-scalar-key cases as well as the NULL-key case addressed by my earlier patch. Please consider your patch in place of mine.

With AI assistance, I reviewed and tested your attached v1 patch against 9e7d152488f197e96f171f0714459c227c3f7693 on Linux x86_64 with GCC 14.2.0 and assertions enabled. All 239 core regression tests passed via make installcheck.

An additional 260-case matrix passed, covering both output types, NULL and non-NULL values, uniqueness checks, scalar keys, arrays, composites, json/jsonb keys, domains, and a user-defined cast to json. Comparing against the unpatched build, 19 previously accepted invalid-key cases were rejected; the other 241 cases retained their results and error behavior.

I also checked omitted keys using a custom type whose output function raises an error. The output function remained uncalled without uniqueness checking, while the existing conversion behavior with WITH UNIQUE KEYS was preserved. Volatile key/value expressions and value-expression errors retained their observed evaluation behavior.

I did not find a correctness issue in these checks.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message 민영재 2026-10-12 07:15:22 Re: BUG #19736: `JSON_OBJECT ... ABSENT ON NULL` accepts invalid keys when the value is NULL
Previous Message QQ Mail 2026-10-12 03:42:47 Re: BUG #19736: `JSON_OBJECT ... ABSENT ON NULL` accepts invalid keys when the value is NULL

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuya Kawata 2026-10-12 06:35:30 Memoize shows only the last execution's stats for parallel workers
Previous Message Jakub Wartak 2026-10-12 06:08:47 Re: pg_*_advice: tsv load failure, etc.