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 1wEzR0-004dr2-0e for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2026 00:57:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wEzQz-0057Rt-1R for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2026 00:57:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wEzQz-0057Rl-0b for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2026 00:57:49 +0000 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wEzQx-00000002DUb-0f8z for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2026 00:57:48 +0000 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-682fce74c06so2957241eaf.3 for ; Mon, 20 Apr 2026 17:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776733065; cv=none; d=google.com; s=arc-20240605; b=YcbaHxlVJYQ/x9OdaeCLLLXyIxoZoHeh/S/1BEaQcz0eAOmT261At/jr42VCwRzj6n 4+IpkXbZErdF9LPJFY18mYgcuDtn2M6TPd/0ommAtm51nDlrt/PEYVqa+u3EDbA4i69c H+MTrUCQ2rKNb4YPeLV/On6AOMSj2WW7HtjH3q5dUnmv6z2A6edu8IoZgSdY7ka2j4dv qDmySfQiwJeP34p95YxnhasZRV3DqXsoUNIJS43WfhUj8vfMLLCul5conkILt2CVDKKr P9raIW8Ljt5Ldk7FT0YTYIUDa/p9UCVBBFLW0/MEP4KN7ADvC7qbGJPhlfSsR44u4R7P Xhfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=At+Zbw3GpOY6qstVFc1YP2YIbEUb5XErOzM9VLETHWE=; fh=YwskJcMuOKRkSz1WZBuU3eBcZUZLS9w14bZeB9IQ1fU=; b=F19yhr2qz+bxT+9GsoUznolvCau6WiXmf8er8F3b22E4mP3DXqgybcN4GjDJ208IoU R9meXZAOYGpN4qGwZeAYfgml35ZtAaSU7k4hpCWaZBFqN/PWr3ent9jXWK46e+ePo1aT jaEItebTYD59HK5q7/nEkOtiykvsmVoIGXe5zEnCv2QsWH+7TBkAwGn8jnFp0xj/oUc1 NAzZndqJwXeSdUxqGDQYo0KKsC1jVL1BMLKjyQCSvCc/GOGaBu9FxmmVgmDUrLKAC1hj owvx5ZASs4Z59rJT5DSmG9V/bN49ewwAUtcWwRjjCJ+KjHc3oDY2EH0GIXmXFetxh3On oTtw==; 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=20251104; t=1776733065; x=1777337865; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=At+Zbw3GpOY6qstVFc1YP2YIbEUb5XErOzM9VLETHWE=; b=qn1ZHkc1h/W95GJEnmJQR3QwLd4spvRKnblFst9/4CkxeA07FAIDRUg1pJCboxIYKW fXLpLH6S+CEam/nsMeJ3G5kUxUFbvvxn8sL+VBBjdeB/v36CqIJzVxZSx94UkXatmojb 12fjf4l+hcm/na+q3zZSeq9VFQchvldTHTH3pcfHhH43yR1jCsYdOfmdcY+cURcE48dt VLx6QsWmzbcf+Igw46XAo3CDxq4hKmiukh6gWJumt/MCCNi5w4hA7fL9oant+v3PEn44 HLMWx+6U0uIpSyk9xno8OYJuiltOhCnQpPn7v/rzE1tsPeD0ecD+KdM1F/K29Up+WdAZ 0lSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776733065; x=1777337865; h=content-transfer-encoding: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=At+Zbw3GpOY6qstVFc1YP2YIbEUb5XErOzM9VLETHWE=; b=PzDOcjVPpRxinTsDaNcXTD89+rxwtUT32zdGcUmWa6rsC1+xxBj7S25dBnYhspMNKK p3d75Vno46HVElxQE7ErNB0rLOzxsULPVETpd49q/1vPZXxGaSevJqn1i2TW5eAtUBw6 Y14CpcsxIpEDEBc4eywkncs0rBgFFOvXsd9yLpIZLKjDjEkEoZLH3cGcNv0QDzo6VX28 GlGiygvYhgD6XT6B/5b0XtFQcb9rFOUPPtZiQyd48onwbWsf3hQ4PRKt0Q8Pay2ohbbb CTft4S7fj24ZpmNgl8FRvbFFfrGjx59T+ztWrTqxpyeAMCKPUI14Yw9BYNffT7lSADx9 28Gg== X-Forwarded-Encrypted: i=1; AFNElJ9rw3UOuuNklvBRPFmfHP7RQft+rPY5gGG6QpFFZkpRrP5pJVZVliKs/k0jwv/RihCX6nWWkGRsKwUs@lists.postgresql.org X-Gm-Message-State: AOJu0Yw0ZgMrEgghKwXs8EriEpQVos2zdhnQbs0bBEPcm13be+bY0UqJ Hf9NL+mi0zUQdqZtnFaUejLwllosRFAiYMNrP2YA+L8+jk6MYI7CXuLa0oJb5gk9Qr1LA9nSOyN J288+ADumouCmLCVS405puJ+xu8NfzlY= X-Gm-Gg: AeBDieumg99lNc8pOkNaK+fDmv5X1mKbgp89BXkU1ZtH2tx7H+Qe3yqltOqMPL6Wa97 3djlJPiamB77OUaH1h5jGYwAFzFfx8LsMGfAJkGIAWLqr8UIYYYsqlAKkfnMUdJcf6fMGKn+lhJ kJf4WGuSpdcA5hIy44CdXb/Eq5UUrX/SRbS2GwG4ZJbFo7o2Ph6oogno1oZXDz7AXEdw8mz4wS2 DSm9TaMZCU55DpFad/aLvKOVKb/E2XyE8d4Rc7+/PbTIcHVU2ex7BW6RBcAKaT9OeTraHovyd0r hpC0rV1x91oz77810U4E X-Received: by 2002:a05:6820:824:b0:68d:9ba5:de28 with SMTP id 006d021491bc7-69462ef80fcmr8781507eaf.28.1776733065445; Mon, 20 Apr 2026 17:57:45 -0700 (PDT) MIME-Version: 1.0 References: <19418-591ba1f29862ef5b@postgresql.org> <2abdb464-27f5-4759-bb0b-f09ab5b5ceab@postgresfriends.org> <501040.1772433449@sss.pgh.pa.us> In-Reply-To: From: Richard Guo Date: Tue, 21 Apr 2026 09:57:34 +0900 X-Gm-Features: AQROBzAO77NqrgIqrDgmN5A-_VjVfCa2xtaEK9hLVEeugmE5yal9Ogb5o34gz9Y Message-ID: Subject: Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 To: Amit Langote Cc: Tom Lane , Vik Fearing , lukas.eder@gmail.com, pgsql-bugs@lists.postgresql.org, =?UTF-8?Q?=C3=81lvaro_Herrera?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 20, 2026 at 6:05=E2=80=AFPM Amit Langote wrote: > Agreed that v4 is the better direction. Thanks for review! > The comment on orig_query could say "not walked" a bit more helpfully, e.= g. > > Node *orig_query; /* for deparse only; not walked (func is) */ Sounds good. > I also noticed that the comment for 'func' is incomplete as it is and > this change warrants an update. Maybe a bit long, but how about: > > Expr *func; /* expression producing the result: > * Aggref/WindowFunc for *AGG, > * CoalesceExpr for ARRAY_QUERY, > * json[b]_xxx() call for remaining types= */ It seems that func is NULL for "remaining types". How about we go with: Expr *func; /* executable expression: * Aggref/WindowFunc for *AGG, * CoalesceExpr for ARRAY_QUERY, * NULL for other types (executor calls * underlying json[b]_xxx() functions) */ (maybe we should place the multi-line comment above the field.) - Richard