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.