Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxK09-008N7a-1p for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Mar 2026 07:17:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxK07-00594k-1R for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Mar 2026 07:17:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxK07-00594c-0d for pgsql-bugs@lists.postgresql.org; Tue, 03 Mar 2026 07:17:03 +0000 Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vxK05-000000008op-0ACH for pgsql-bugs@lists.postgresql.org; Tue, 03 Mar 2026 07:17:02 +0000 Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-5ff18242343so1352203137.2 for ; Mon, 02 Mar 2026 23:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772522220; cv=none; d=google.com; s=arc-20240605; b=HNn4b46B8ivwj6p78FRPMzBrB3E58SXO0l6Dw+woKTUUOYC0pJgXjKcckfUz7/z+1t kbqiTl3Qm1Jf7S0nxE7cKrXlVVySRwuXveChL0cVZ7JaVRY8RiC1hT5IhUcz6k/fOQb0 x2T2A3H7SDyuuLyX0G8ccJpENz3oS/sK2su85TYDltgaBIUGQcA/wLyb6ksGCbHe5Zt4 1/nL+AUs8Bp0n439dL1j0Hn6T7gB6FIc0T3pzqrHIeVlc0jwRLfZgE1uywChF5eE4Xsj ZURjJUncSDHX/bzJQ8D0ClswgCZxlPiBFqzk8yHokBsafsNukcufdrJFSGhr9Mpm7cSr 5ZlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=+7fnIyp8SSqvgO5V15vYiEfhUjushMixEnID8lb5XG8=; fh=UEZaF5BdixL7gUsx7QGQh3Q63G2mBcPF0EkrDSrGFjA=; b=K+FeqrqlKGYv4qVtr2J26XwICxoeqQikI6k+brFANiAy6Gk3zqJJoGiEPfTaQiCnuK pTSP1QxEwJPhysQceQcD2iPCkkF5loDH6qGwDUsU09dP3draKwsx3T+blQW0Tr9Ag0ys HbuVeAANq7vaqqrAiL3yw77onV4G83DWPhMvwr4swOV5aV81/v9Golk5qEVknww10A9F fwlkxYl4fH9n6KaxGYFfBgmM2nAzeJZ03sAK0G3AlFH3ROr/Mi9BfE5GMf46dKxy1UFs 1koAdKLUSC06W5rbwNImFjEmLnYCIDwZ6BCNiy/i+OnfKLJmq+HN0S4VbRHlfmDIdfIm vDew==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772522220; x=1773127020; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+7fnIyp8SSqvgO5V15vYiEfhUjushMixEnID8lb5XG8=; b=crR9H8fU2xXJVEa1LaW5p+vRdY8KW5OXPp3DcwVMEhtGi6/uNM2Hnqc7xVM2mQNefT nfXnuKiK3VFPOBNhvacbfY7OO8xHfBGTQXz0rs67LDOTvohsVDKums5DBzzb5RMlCder JTw9xqXgm8Zx0yAwHXc9i0x9eQ4WxXWcDbB9VAy/J+PFZMHdQxnl7T4vNC8amb/w3OST MOycTqAhxifzvOHRu1HOYI36HWMF1PO7zWDpizuMekizpAlgrvt4GGKxBxpV5b9HuEQC ctuHX82YQNXS2AKh+OlcR15XsSH5mLzaXSLmcH2cE9z0c/5L8ZCU8H6FySOZqqK6Vw9L cEfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772522220; x=1773127020; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+7fnIyp8SSqvgO5V15vYiEfhUjushMixEnID8lb5XG8=; b=l+R/BxdA6X9u5zr4HyNT1/NAeESlXqLSAgO0KJqoTGwGkkL1UKTYNtPgdNK4R9gqpP NcJlheensFGHagD3VyeD6qU4HQWFnsOk0MhPnj//WFM1yfg/ftMoxhsLNjTY6RPzDPTY 1NjIhaqHHT/pQ2UgTuY2R/+httfH6NsrQJVReM3WJvjHgVj8/KMTGNs3uydmwqI+5qA8 fURx0g1OCXagF2MiRHjp3yn8h1QgNu93W+5N7c4hI5LspAW0080MeZ9GsnAnt1TptlIu YoktpkU5XOrOc1y6lmsY9BeU+eRyfD8YfvDaMSle9YbvvTF+byU530plqNEShcpOFxI3 liEQ== X-Forwarded-Encrypted: i=1; AJvYcCXLRA/DxgoabIFkzV4ml21+wV8T2sixOtPJtQgofn1VJ0NqquqmWnIQUphxbbYAHyCGP1uVimQykPT6@lists.postgresql.org X-Gm-Message-State: AOJu0Yzv3V0nBj4d53Z/VUrP3GDIUzAJecVl6OmW91TNJsMigleMIy/j UdSCI9dutX49RMISuRJDYDkPKP0e+LBpltjJN7RlhbU4XHUzh9PvfVHzITCFqu9nptlREM1ROQw uEMtLPDFq6RaloX284K/jpSEELy6QxxQ= X-Gm-Gg: ATEYQzz5Rtefv0jsHX/x3laCI53/eq4xG5MDd4lmFWD99zaT5bxGbM42F5kWoL8olUN jDkyFYeGsnwJeBpQmPN5LIo72j5abaDvwWAv4Ititfj7Q1gYBPksPJ71u8IZJxqfhVoCQ46/c2w Q/UqAhUNFjcUa53QSouFcG4uAJbFb2Ng6hDgH+KEFn36fF6empCkzcI6BLJiLfAUIPH3PzEHdex J2m4+4nL4KAjTgt3gp8f+y0NEMn5ShZ8CJzxUnqaPkBSudzQ+ZTqiKBljqKau+kaxM4EBTBpRy1 yx9887D5JXu801WY5sUYmYcBX7VgRct7IyKo7c7wPCjAgwhKzFI/BcRwHuhxXZOuhUeWGruW8Tu nGNSBWYk= X-Received: by 2002:a05:6102:c08:b0:5ff:1d94:b744 with SMTP id ada2fe7eead31-5ff3234b397mr5252486137.13.1772522220250; Mon, 02 Mar 2026 23:17:00 -0800 (PST) MIME-Version: 1.0 References: <19418-591ba1f29862ef5b@postgresql.org> <2abdb464-27f5-4759-bb0b-f09ab5b5ceab@postgresfriends.org> In-Reply-To: From: Lukas Eder Date: Tue, 3 Mar 2026 08:16:49 +0100 X-Gm-Features: AaiRm50XYowu9qF2GKh-dM0-wzfktFSV4l-ArwORDNi6M6aMkUoDC4abtZ7Vfa4 Message-ID: Subject: Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 To: jian he Cc: Vik Fearing , pgsql-bugs@lists.postgresql.org, PG Bug reporting form Content-Type: multipart/alternative; boundary="0000000000004b6af7064c197de4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004b6af7064c197de4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That was a typo. I meant to refer to JSON_ARRAY, not JSON_VALUE in the subject title. The issue is specifically about (I also made a typo there, sorry for that) On Tue, Mar 3, 2026 at 3:42=E2=80=AFAM jian he wrote: > On Thu, Feb 26, 2026 at 10:20=E2=80=AFPM Vik Fearing > 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/ > --0000000000004b6af7064c197de4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That was a typo. I meant to refer to JSON_ARRAY, not JSON_= VALUE in the subject title. The issue is specifically about=C2=A0<JSON a= rray constructor by query> (I also made a typo there, sorry for that)
On Tue, Mar 3, 2026 at 3:42=E2=80=AFAM jian he <jian.universality@gmail.com&g= t; wrote:
On Thu= , Feb 26, 2026 at 10:20=E2=80=AFPM Vik Fearing <vik@postgresfriends.org> wrote:=
>
> > Try this:
> >
> >=C2=A0 =C2=A0 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/
--0000000000004b6af7064c197de4--