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

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Langote <amitlangote09(at)gmail(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, lukas(dot)eder(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, rmt(at)lists(dot)postgresql(dot)org, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
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-04-24 19:58:25
Message-ID: aevLYeoSSgiwEiO-@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Apr 23, 2026 at 09:55:10AM +0900, Richard Guo wrote:
>> Hi RMT,
>>
>> I'd like to commit a fix for JSON_ARRAY(subquery) behavior that
>> involves a user-visible incompatibility, and would appreciate your
>> go/no-go since we're past feature freeze.
>>
>> Summary:
>>
>> - JSON_ARRAY(SELECT ...) currently returns NULL over an empty result
>> set, but the SQL/JSON standard requires it to return '[]'. Fixing
>> this changes user-visible output.
>>
>> - The same patch also fixes a deparsing issue: views defined with
>> JSON_ARRAY(SELECT ...) are dumped back as the internal JSON_ARRAYAGG
>> rewrite instead of the original syntax.

I am fine with committing this for v19, assuming there is consensus on the
patch content.

Heikki/Melanie: Any objections?

--
nathan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2026-04-24 22:32:04 Re: BUG #19457: RE: pgp_sym_encrypt silently accepts non-FIPS ciphers (bf, cast5, 3des) when OpenSSL is in FIPS mod
Previous Message Peter Eisentraut 2026-04-24 15:41:50 Re: to_date()/to_timestamp() silently accept month=0 and day=0