Hi

st 4. 11. 2026 v 13:54 odesílatel Jim Jones <[email protected]>
napsal:

> 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
>

yes, it is correct. I was confused (and the name of the function is little
bit confusing)

When xmlexpr_is_immutable returns false, then it means - yes, the
expression is 100% mutable. When returned true,  it means - know nothing,
check arguments - continue in node walking.

After some time  it is hard to return to work with reversed logic in walker
iterators.

Regards

Pavel






> Best, Jim
>
>
>

Reply via email to