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 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)), '$');