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 1vs1Iz-000wRU-0b for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Feb 2026 16:18: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 1vs1Iy-003rpW-02 for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Feb 2026 16:18:36 +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 1vs1Ix-003rpN-1y for pgsql-bugs@lists.postgresql.org; Mon, 16 Feb 2026 16:18:35 +0000 Received: from mail-vk1-xa43.google.com ([2607:f8b0:4864:20::a43]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vs1Iv-000000012zo-05vx for pgsql-bugs@lists.postgresql.org; Mon, 16 Feb 2026 16:18:35 +0000 Received: by mail-vk1-xa43.google.com with SMTP id 71dfb90a1353d-5662c2937fdso2792599e0c.0 for ; Mon, 16 Feb 2026 08:18:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1771258710; x=1771863510; darn=lists.postgresql.org; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=DtnmfdeGexw8M3gJA0//Z12/8jzX9mdT5sz9yyLS2mg=; b=xoO5Rf3K0plm6onWrgwDW6yv30U9hV45jg3a3p9pg1WlyQkJKAqbreRW7WVvpeXH66 jy8qdSqvOxG8Q7cusyphvmJQyMO78O713HFuFMKorWHdK7tmENgRCpdf7eb36BuDG26f dl1a+fPC5CwN/y5q8YTw5GChoSzN2p+aWw5wlJZVh/AB1/Zh4rJi1Mi3D2FyYB8F69GS Y7/oczuHyHo6C8gewBdqSNO6URGqTL+PuM590Vaqv2lXt3NZBBD4suo9BcAXuUHl5bDK 8hSrWuT2NTMs4Jo19n6opQoNCvcd4oUMJIFpdTNVkqeP1MVHSdcHokEzHwS2jDjfaa4W w4QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771258710; x=1771863510; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DtnmfdeGexw8M3gJA0//Z12/8jzX9mdT5sz9yyLS2mg=; b=j9OlOI4myumXLRZet4aTmQA2lBDfyrzRsISk5PiUBF0l7Rw1YXRSe+YMEFdBTFeCOL B+kLqstDLhSOVV0QK0BeCBLf9NF+2bJRcuDM3cMdN7fBDR9t3JcAdH7j7FjionhLc6Bj wfNw4rBGVoBp6yLZGpqkHNn8n+DVTJoXpQl/6h4YlzJX5uA8MtuPJBWG3thlxRJvOf01 HFVxHqpjdTyba6IH4Jnd8ExMQ3nhsYxPwOuYMuHVIMQOsLMqOeOxckdYyWWMyOmvGRsm du3dYEp4ECphVWFQpgJS6fLnWCQz5SLuawRmC9UAT0jmNNJAxYvFe+Ds8Z6Rv1XZ84fT xLtw== X-Gm-Message-State: AOJu0YyJvtD+bDhsOObOZIwlti1AFguBzxanZCc9B34nlXCUA6hTdAl5 x5fVotn4y65iI3dSIqkdlMV/8OZ2evTVemofIrn4PmOnjs6IRwNLUKNH2UEMM15MyNdOts5JsiO aSlEDcMjVkA== X-Gm-Gg: AZuq6aKkrB4vWWZwaQMEVHFXTQZ5n2zDFb3zZ4zMXaGf5hvqGLbTUI3mcI0NkhW0jE5 MpvT4WGEI9AiJEUxdNvFSzaL+l5sGvnzJLYPaNlZGbfe/WwAdd/cErxv2d+GJLMsPaA8r5qIr4P uq8AgEqrWv1jaDGm+uB628citvRcY5dqe99Pt6wh8fSb2YiGF9S6AGlvORvkUsDtrD0r1OuEdLt MxZuWAQvLuavyD0MJv2sFjxhp4Y5nclndwAueH+Bj5iV1SyVcimSipbovgGM8WYOSuV0eYHD4b5 rF2IeHT8qdqXQbDMLggnUv3iyMmDQx1+jNpZqRFvo2W7KOCVwSURMTIxj7g1/ENBJVvmOCGVAp9 L/Z9nvuDA3pCANgPHS4K7RdG5opEpryiBR/bsdqqRu1jYTTZIjo5gB8602uY5OHjjQJKFPOJJSw SntPv4r98uPzPc/+4JXMzY292GvJMZFw== X-Received: by 2002:a05:6122:6c09:b0:568:8dde:5384 with SMTP id 71dfb90a1353d-5688dde554emr1909940e0c.5.1771258709994; Mon, 16 Feb 2026 08:18:29 -0800 (PST) Received: from ?IPV6:2605:a601:a6b0:500::1cb? ([2605:a601:a6b0:500::1cb]) by smtp.googlemail.com with ESMTPSA id a1e0cc1a2514c-94afd14d749sm7029662241.1.2026.02.16.08.18.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Feb 2026 08:18:29 -0800 (PST) Content-Type: multipart/alternative; boundary="------------vCCib0jZZuMJTj2FzgQFqQjk" Message-ID: Date: Mon, 16 Feb 2026 11:18:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable. To: Tom Lane , lucio.chiessi@trustly.com Cc: pgsql-bugs@lists.postgresql.org, Florents Tselai References: <19409-e16cd2605e59a4af@postgresql.org> <562481.1771013899@sss.pgh.pa.us> From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65Fw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1c4VGRqAaYL++LAEOqrlvm2Tvq QqZRtnEAEQEAAcLAfAQYAQgAJgIbDBYhBOQ+WEYd/Hy/RGkVpZn6f8tZ/DuBBQJoGNI2BQkd EODdAAoJEJn6f8tZ/DuBfw0IAKTsfD40teP/pp+bsLLMSxPXUYrrprTj7WFB5v61p6dkpSr/ qXmMlyahdxQFaPmfVgVirB1Vk/kHiWNnnGjfUV9nB2Zg9LI0Xb9/ts3LsUiRWXzG3tkMY6XL vsVOxW4XFRND9l2q+WW93aZ1DZl+fqWfYgMvsusFRhmGFOKTRfKPta2Pkv+AhA24N4+PrR5p bU4k2MO8PAGiK8eaYKGFG1bHKuAvoDoF7WXJ3FHxuWqLnKEt4dfOLm5pAe3zq1Lt6q8azT9i QWGpSAK5vQUWQHBHpiDjdPeqKZ6HiAXIIKfSmb+jrvXBqoP+D6/K7rUjG2aXiRtTIAXms9sm VRu7cmw= In-Reply-To: <562481.1771013899@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------vCCib0jZZuMJTj2FzgQFqQjk Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2026-02-13 Fr 3:18 PM, Tom Lane wrote: > PG Bug reporting form writes: >> ... this fails in PostgreSQL 18, because the jsonb_strip_nulls ( target >> jsonb [,strip_in_arrays boolean ] ) function changed from immutable to >> stable. > A bit of git excavation shows that this changed here: > > Author: Andrew Dunstan > Branch: master Release: REL_18_BR [4603903d2] 2025-03-05 10:04:02 -0500 > > Allow json{b}_strip_nulls to remove null array elements > > An additional paramater ("strip_in_arrays") is added to these functions. > It defaults to false. If true, then null array elements are removed as > well as null valued object fields. JSON that just consists of a single > null is not affected. > > Author: Florents Tselai > > Discussion:https://postgr.es/m/4BCECCD5-4F40-4313-9E98-9E16BEB0B01D@gmail.com > > It looks like a thinko to me, because surely the strip_in_arrays > parameter did not make the function more mutable than before. > Nor did a quick search find any discussion of the point in the > thread. > > Yeah. In penance for this I have worked up a mechanism to generate default-setting statements from pg_proc.dat that I will post separately about in -hackers. In the meantime, I guess we should fix it in release 18 and master, with a release note that people might need to do a manual update if affected, along the lines of    update pg_proc set provolatile = 'i' where oid in (3261,3262); cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------vCCib0jZZuMJTj2FzgQFqQjk Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2026-02-13 Fr 3:18 PM, Tom Lane wrote:
PG Bug reporting form <noreply@postgresql.org> writes:
... this fails in PostgreSQL 18, because the jsonb_strip_nulls ( target
jsonb [,strip_in_arrays boolean ] ) function changed from immutable to
stable.
A bit of git excavation shows that this changed here:

Author: Andrew Dunstan <andrew@dunslane.net>
Branch: master Release: REL_18_BR [4603903d2] 2025-03-05 10:04:02 -0500

    Allow json{b}_strip_nulls to remove null array elements
    
    An additional paramater ("strip_in_arrays") is added to these functions.
    It defaults to false. If true, then null array elements are removed as
    well as null valued object fields. JSON that just consists of a single
    null is not affected.
    
    Author: Florents Tselai <florents.tselai@gmail.com>
    
    Discussion: https://postgr.es/m/4BCECCD5-4F40-4313-9E98-9E16BEB0B01D@gmail.com

It looks like a thinko to me, because surely the strip_in_arrays
parameter did not make the function more mutable than before.
Nor did a quick search find any discussion of the point in the
thread.

			


Yeah. <paperbag> 

In penance for this I have worked up a mechanism to generate default-setting statements from pg_proc.dat that I will post separately about in -hackers. In the meantime, I guess we should fix it in release 18 and master, with a release note that people might need to do a manual update if affected, along the lines of

   update pg_proc set provolatile = 'i' where oid in (3261,3262);


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------vCCib0jZZuMJTj2FzgQFqQjk--