isSimpleNode() and related code treated every XmlExpr as self-delimiting. Most of them are, because they look like function calls with some extra decoration. But "x IS DOCUMENT" is not: it is a postfix test, like IS NULL. Printed as the operand of another operator, or as the operand of a postfix test, it was therefore not parenthesized and could not be parsed back, or was parsed as something unintended. Under-parenthesization occurred even in non-pretty-print cases, so that this could break dump/restore workflows. To fix, treat IS DOCUMENT as neither simple nor function-like, and give it the same treatment as other postfix tests. Also pass the single argument of IS DOCUMENT, not the argument list, to get_rule_expr_paren(). This avoids unnecessary parenthesization of the argument. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Prashant Chinnam <crprashant@hotmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zDuPSkc8ihCctV67Lxbqock+S4wqCHHo8xxZ1t4teXo0g@mail.gmail.com Backpatch-through: 14
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/17/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/17/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/.