BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable. - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable.
Date
Msg-id 19409-e16cd2605e59a4af@postgresql.org
Whole thread Raw
Responses Re: BUG #19409: Function jsonb_strip_nulls() changed from immutable to stable.
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      19409
Logged by:          Lucio Chiessi
Email address:      lucio.chiessi@trustly.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.





pgsql-bugs by date:

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