eval_const_expressions() didn't constant-fold XmlExpr. In some cases it cannot, but often it can. Failure to do so can cause visible regressions in SQL-language function behavior compared to pre-v18, though only in a rather narrow set of contexts: basically, if you're trying to use a CASE to prevent evaluation of a failure-prone XML function. While we're at it, make contain_mutable_functions() handle XmlExpr more precisely, and adjust some comments that justify not treating XmlExpr explicitly. This seems worth sneaking into v19, but I'm hesitant to put it into v18. It's not really a bug fix, because we disclaim the safety of using CASE this way, and it carries some risk of de-optimizing queries that worked satisfactorily before. Bug: #19487 Reported-by: Ilya Portnov <i.portnov@compassplus.com> Author: Andrey Rachitskiy <pl0h0yp1@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19487-367258bc497b923a@postgresql.org Backpatch-through: 19
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/19/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/19/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.