Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 <JSON value constructor>

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vik Fearing <vik(at)postgresfriends(dot)org>, lukas(dot)eder(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Subject: Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 <JSON value constructor>
Date: 2026-03-03 14:32:12
Message-ID: CAMbWs4-NuYP+0Zq9=Ufwy5GcM0XQnEqWjJFucaRGO4EQgiCcow@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Mar 3, 2026 at 10:03 AM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> That is a good point I hadn't considered. So I think the ideal fix is
> to have the parser preserve the user's original JSON_ARRAY(query)
> syntax as much as possible, and then defer the JSON_ARRAYAGG rewrite
> trick to the planner, perhaps during expression preprocessing.

I tried hacking on this idea to see how it would look in practice, and
here is what I got.

- Richard

Attachment Content-Type Size
v2-0001-Fix-JSON_ARRAY-query-empty-set-handling-and-view-.patch application/octet-stream 21.7 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dirkjan Bussink 2026-03-03 15:02:08 JSON_SERIALIZE for JSONB returns parts of the internal JSONB representation
Previous Message Tom Lane 2026-03-03 14:28:24 Re: BUG #19423: canonicalize_path does not function correctly when processing paths that contain . and ..