Revert commit 66c0185a3 and follow-on patches.
commit7204f35919b7e021e8d1bc9f2d76fd6bfcdd2070
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 May 2024 19:08:30 +0000 (20 15:08 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 May 2024 19:08:30 +0000 (20 15:08 -0400)
treed9a6ed2112d569e2c6b52eb60773c8524b37f1b2
parentd2a04470aa6401c1938cc107e0b2c56c22a2321f
Revert commit 66c0185a3 and follow-on patches.

This reverts 66c0185a3 (Allow planner to use Merge Append to
efficiently implement UNION) as well as the follow-on commits
d5d2205c83b1a7eb287487044d6.  In addition to those, 07746a8ef
had to be removed then re-applied in a different place, because
66c0185a3 moved the relevant code.

The reason for this last-minute thrashing is that depesz found a
case in which the patched code creates a completely wrong plan
that silently gives incorrect query results.  It's unclear what
the cause is or how many cases are affected, but with beta1 wrap
staring us in the face, there's no time for closer investigation.
After we figure that out, we can decide whether to un-revert this
for beta2 or hold it for v18.

Discussion: https://postgr.es/m/Zktzf926vslR35Fv@depesz.com
(also some private discussion among pgsql-release)
18 files changed:
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/sql/postgres_fdw.sql
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/equivclass.c
src/backend/optimizer/path/pathkeys.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/prep/prepunion.c
src/backend/parser/analyze.c
src/include/nodes/pathnodes.h
src/include/optimizer/paths.h
src/include/optimizer/planner.h
src/include/optimizer/prep.h
src/test/regress/expected/collate.icu.utf8.out
src/test/regress/expected/incremental_sort.out
src/test/regress/expected/union.out
src/test/regress/sql/collate.icu.utf8.sql
src/test/regress/sql/union.sql