Re: BUG #19487: Error while executing SQL query involving XML parsing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
Cc: i(dot)portnov(at)compassplus(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19487: Error while executing SQL query involving XML parsing
Date: 2026-08-30 18:03:58
Message-ID: 880213.1788113038@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com> writes:
> I think you're right. Fixed it in v3.

I spent some time looking at this, and felt that what we really
ought to do is update clauses.c's handling of XmlExpr across the
board. In particular, contain_mutable_functions really shouldn't
allow XmlExpr in cases where we know it's not immutable. So more
or less as attached, where I also spent more effort on the comments.

I've got mixed emotions about back-patching this. It's not really
a bug fix, because we already disclaim the safety of relying on
CASE for this purpose, cf [1]. I think it might still be reasonable
to sneak into v19, but I'm unsure that putting it into 18 is a good
idea.

regards, tom lane

[1] https://www.postgresql.org/docs/current/sql-expressions.html#SYNTAX-EXPRESS-EVAL

Attachment Content-Type Size
v4-0001-Handle-XmlExpr-more-honestly-in-clauses.c.patch text/x-diff 7.7 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Rachitskiy 2026-08-30 18:35:13 Re: BUG #19487: Error while executing SQL query involving XML parsing
Previous Message PG Bug reporting form 2026-08-30 17:08:49 BUG #19647: Difference in pg_basebackup behaviour between PostgreSQL <= 16 and >= 17 with pgactive extension