Hi Pavel

On 04/11/2026 09:42, Pavel Stehule wrote:
> I don't understand why IS_XMLCONCAT is marked as immutable. In this
> case, the result should depend on arguments, and arguments can be stable.

I'd say that it's because it will always return the same result for the
same inputs. If any argument is not immutable, the whole expression is
not immutable either:

psql (20devel)
Type "help" for help.

postgres=# create table t1 (foo xml, bar xml generated always as
(xmlconcat(foo,'<a/>')) stored);
CREATE TABLE

postgres=# create table t2 (foo xml, bar xml generated always as
(xmlconcat(foo,now()::text::xml)) stored);
ERROR:  generation expression is not immutable

Best, Jim




Reply via email to