Go to file
Tom Lane 630520c22f Avoid assertion failure if a setop leaf query contains setops.
Ordinarily transformSetOperationTree will collect all UNION/
INTERSECT/EXCEPT steps into the setOperations tree of the topmost
Query, so that leaf queries do not contain any setOperations.
However, it cannot thus flatten a subquery that also contains
WITH, ORDER BY, FOR UPDATE, or LIMIT.  I (tgl) forgot that in
commit 07b4c48b6 and wrote an assertion in rule deparsing that
a leaf's setOperations would always be empty.

If it were nonempty then we would want to parenthesize the subquery
to ensure that the output represents the setop nesting correctly
(e.g. UNION below INTERSECT had better get parenthesized).  So
rather than just removing the faulty Assert, let's change it into
an additional case to check to decide whether to add parens.  We
don't expect that the additional case will ever fire, but it's
cheap insurance.

Man Zeng and Tom Lane

Discussion: https://postgr.es/m/tencent_7ABF9B1F23B0C77606FC5FE3@qq.com
2024-11-20 12:03:47 -05:00
config Log LLVM library version in configure output. 2023-10-22 14:32:31 +13:00
contrib Count contrib/bloom index scans in pgstat view. 2024-11-12 20:57:35 -05:00
doc Release notes for 17.2, 16.6, 15.10, 14.15, 13.18, 12.22. 2024-11-16 17:09:53 -05:00
src Avoid assertion failure if a setop leaf query contains setops. 2024-11-20 12:03:47 -05:00
.dir-locals.el
.editorconfig Add .editorconfig 2019-12-18 09:13:13 +01:00
.git-blame-ignore-revs Backpatch addition of .git-blame-ignore-revs 2022-08-05 19:36:24 +02:00
.gitattributes
.gitignore Add portlock directory to .gitignore 2022-11-26 07:47:16 -05:00
aclocal.m4 Probe $PROVE not $PERL while checking for modules needed by TAP tests. 2021-11-22 12:54:52 -05:00
configure Stamp 13.18. 2024-11-18 15:39:24 -05:00
configure.in Stamp 13.18. 2024-11-18 15:39:24 -05:00
COPYRIGHT Update copyright for 2024 2024-01-03 20:49:04 -05:00
GNUmakefile.in Remove temporary portlock directory during make [dist]clean. 2022-11-26 10:30:58 -05:00
HISTORY Canonicalize some URLs 2020-02-10 20:47:50 +01:00
Makefile
meson.build Disable clang 16's -Wcast-function-type-strict. 2024-11-08 09:44:01 +10:30
README Canonicalize some URLs 2020-02-10 20:47:50 +01:00
README.git Canonicalize some URLs 2020-02-10 20:47:50 +01:00

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.

PostgreSQL has many language interfaces, many of which are listed here:

	https://www.postgresql.org/download/

See the file INSTALL for instructions on how to build and install
PostgreSQL.  That file also lists supported operating systems and
hardware platforms and contains information regarding any other
software packages that are required to build or run the PostgreSQL
system.  Copyright and license information can be found in the
file COPYRIGHT.  A comprehensive documentation set is included in this
distribution; it can be read as described in the installation
instructions.

The latest version of this software may be obtained at
https://www.postgresql.org/download/.  For more information look at our
web site located at https://www.postgresql.org/.