Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 - Mailing list pgsql-bugs

From Lukas Eder
Subject Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34
Date
Msg-id CAB4ELO7eg5O4+Z+Xt653FX9EDkyZzV-JO6ii73q9sK17gg9LpA@mail.gmail.com
Whole thread
In response to Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34  (jian he <jian.universality@gmail.com>)
List pgsql-bugs
That was a typo. I meant to refer to JSON_ARRAY, not JSON_VALUE in the subject title. The issue is specifically about <JSON array constructor by query> (I also made a typo there, sorry for that)

On Tue, Mar 3, 2026 at 3:42 AM jian he <jian.universality@gmail.com> wrote:
On Thu, Feb 26, 2026 at 10:20 PM Vik Fearing <vik@postgresfriends.org> wrote:
>
> > Try this:
> >
> >    select json_array(select 1 where false);
> >
> > It produces NULL, not []
>
>
> I can confirm that postgres violates the standard here.
>
> --

Since the subject title mentioned JSON_VALUE.

SELECT JSON_VALUE(((select NULL where false)), '$');
SELECT JSON_QUERY(((select NULL where false)), '$');
SELECT JSON_EXISTS(((select NULL where false)), '$');

Should the above produce []?



--
jian
https://www.enterprisedb.com/

pgsql-bugs by date:

Previous
From: jian he
Date:
Subject: Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34
Next
From: Michael Paquier
Date:
Subject: Re: BUG #19422: Malformed raius packet