BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable.

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: lucio(dot)chiessi(at)trustly(dot)com
Subject: BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable.
Date: 2026-02-13 19:51:03
Message-ID: 19409-e16cd2605e59a4af@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19409
Logged by: Lucio Chiessi
Email address: lucio(dot)chiessi(at)trustly(dot)com
PostgreSQL version: 18.1
Operating system: MacOS 15.7.3
Description:

Hello. We are using, in PostgreSQL 16, the function
jsonb_strip_nulls(jsonb) in a calculated table column, as shown below:

attributes_hash text generated always as
(md5(jsonb_strip_nulls(attributes)::text)) stored,

But using PostgreSQL 18 we having this error:
[ERROR] SQL State : 42P17
[ERROR] Error Code : 0
[ERROR] Message : ERROR: generation expression is not immutable

But this fails in PostgreSQL 18, because the jsonb_strip_nulls ( target
jsonb [,strip_in_arrays boolean ] ) function changed from immutable to
stable.
In PostgreSQL. I used the query below in both versions, with this change:

select proname,provolatile,pronargs,proparallel,proargnames
from pg_proc
where proname in ('jsonb_strip_nulls') and prokind = 'f';

In PostgreSQL 16.6, we have the value of 'provolatile' column as 'i', and in
PostgreSQL 18.1 as 's'.
I can't find any information about this change in the Release Notes v18.

Can we consider this a bug, or is this a normal behavior introduced in v18?
Thanks a lot.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2026-02-13 20:18:19 Re: BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable.
Previous Message PG Bug reporting form 2026-02-13 19:05:56 BUG #19408: Bad plan for UNION ALL subquery with outer WHERE, ORDER BY, LIMIT, and separate indexes