agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrey Rachitskiy <pl0h0yp1@gmail.com>
Cc: i.portnov@compassplus.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19487: Error while executing SQL query involving XML parsing
Date: Fri, 28 Aug 2026 15:49:13 -0400
Message-ID: <1589702.1787946553@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB8bMisngV0L9L3dZkpuStTboHXkVPr0=NBhCNpDxg3r+Bheog@mail.gmail.com>
References: <19487-367258bc497b923a@postgresql.org>
	<CAB8bMisngV0L9L3dZkpuStTboHXkVPr0=NBhCNpDxg3r+Bheog@mail.gmail.com>

Andrey Rachitskiy <pl0h0yp1@gmail.com> writes:
> # Proposal Fix
> Fold constant `XmlExpr` in `eval_const_expressions` (same path as
> `MinMaxExpr` / `ArrayExpr`), so `IS DOCUMENT` becomes a boolean Const and
> CASE drops the unused arm before simplifying `xpath()`.

I don't object to simplifying XmlExpr where possible, but this patch
appears to believe that every variant of XmlExpr is immutable.
This is demonstrably false, eg

regression=# set timezone = 'America/New_York';
SET
regression=# SELECT xmlforest('2026-08-28 12:00 UTC'::timestamptz AS foo);
              xmlforest               
--------------------------------------
 <foo>2026-08-28T08:00:00-04:00</foo>
(1 row)

regression=# set timezone = 'America/Chicago';
SET
regression=# SELECT xmlforest('2026-08-28 12:00 UTC'::timestamptz AS foo);
              xmlforest               
--------------------------------------
 <foo>2026-08-28T07:00:00-05:00</foo>
(1 row)

So you need to take a closer look at which variants can be promised to
be immutable.

			regards, tom lane





view thread (11+ messages)  latest in thread

Message-ID: <1589702.1787946553@sss.pgh.pa.us>
Permalink:  ../1589702.1787946553@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1589702.1787946553@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pl0h0yp1@gmail.com, i.portnov@compassplus.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19487: Error while executing SQL query involving XML parsing
  In-Reply-To: <1589702.1787946553@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox