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 1vwwuP-0060Jo-2n for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Mar 2026 06:37:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vwwuN-00Fdcx-2q for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Mar 2026 06:37:35 +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 1vwwuN-00Fdcp-20 for pgsql-bugs@lists.postgresql.org; Mon, 02 Mar 2026 06:37:35 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vwwuJ-000000027Kj-3AO3 for pgsql-bugs@lists.postgresql.org; Mon, 02 Mar 2026 06:37:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 6226bThY501041; Mon, 2 Mar 2026 01:37:29 -0500 From: Tom Lane To: Richard Guo cc: Vik Fearing , lukas.eder@gmail.com, pgsql-bugs@lists.postgresql.org, =?UTF-8?Q?=C3=81lvaro_Herrera?= Subject: Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 In-reply-to: References: <19418-591ba1f29862ef5b@postgresql.org> <2abdb464-27f5-4759-bb0b-f09ab5b5ceab@postgresfriends.org> Comments: In-reply-to Richard Guo message dated "Mon, 02 Mar 2026 14:45:03 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <501039.1772433449.1@sss.pgh.pa.us> Date: Mon, 02 Mar 2026 01:37:29 -0500 Message-ID: <501040.1772433449@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > Regarding back-patching, I believe this fix is safe to back-patch to > stable branches. However, similar to a nearby bug fix, this will only > apply to newly created views. Existing views will continue to exhibit > the old behavior until recreated. Okay, but ... > Additionally, this changes the > user-facing output from NULL to [], so users may need to update any > application code that relied on the NULL behavior. ... doesn't that point disqualify it from being back-patched? People don't like unprompted behavioral changes in minor releases. "This is what the standard says" is not strong enough to justify changing behavior that was not obviously broken (like, say, crashing). Another point is that the previous coding already failed to be round-trippable, ie you wrote JSON_ARRAY() but what comes out in view decompilation is JSON_ARRAYAGG(). This makes that situation considerably worse. We should endeavor to not expose implementation details like that. (To be clear, I don't object if EXPLAIN shows that sort of thing. But it shouldn't creep into view dumps. We've regretted doing that in the past.) regards, tom lane