pgsql: Doc: return 66c0185a3 to the release notes.

2024-05-21 Thread Robert Haas
Doc: return 66c0185a3 to the release notes.

This reverts commit e1e83a71715f1c2f0717bb66e630ca3bda79b9c1.

Per further discussion on pgsql-release, we wish to ship beta1 with
that feature, and patch the bug, rather than shipping beta1 with
that feature reverted.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/3bd7b2f465deb48c0d37ed6a41bd864771f44390

Modified Files
--
doc/src/sgml/release-17.sgml | 11 +++
1 file changed, 11 insertions(+)



pgsql: Fix generate_union_paths for non-sortable types.

2024-05-21 Thread Robert Haas
Fix generate_union_paths for non-sortable types.

The previous logic would fail to set groupList when
grouping_is_sortable() returned false, which could cause queries
to return wrong answers when some columns were not sortable.

David Rowley, reviewed by Heikki Linnakangas and Álvaro Herrera.
Reported by Hubert "depesz" Lubaczewski.

Discussion: http://postgr.es/m/zktzf926vslr3...@depesz.com
Discussion: 
http://postgr.es/m/CAApHDvra=c8_zzt0j-tftbywn2y+ojfnjnjfg4dfdi2s+qz...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/c37267162e889fe783786b9e28d1b65b82365a00

Modified Files
--
src/backend/optimizer/prep/prepunion.c | 21 -
src/test/regress/expected/union.out| 13 +
src/test/regress/sql/union.sql |  6 ++
3 files changed, 31 insertions(+), 9 deletions(-)



pgsql: Re-allow planner to use Merge Append to efficiently implement UN

2024-05-21 Thread Robert Haas
Re-allow planner to use Merge Append to efficiently implement UNION.

This reverts commit 7204f35919b7e021e8d1bc9f2d76fd6bfcdd2070,
thus restoring 66c0185a3 (Allow planner to use Merge Append to
efficiently implement UNION) as well as the follow-on commits
d5d2205c8, 3b1a7eb28, 7487044d6.

Per further discussion on pgsql-release, we wish to ship beta1 with
this feature, and patch the bug that was found just before wrap,
rather than shipping beta1 with the feature reverted.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/12933dc6048902ba891f9572cab96981f50ef669

Modified Files
--
contrib/postgres_fdw/expected/postgres_fdw.out |   7 +
contrib/postgres_fdw/sql/postgres_fdw.sql  |   9 +
src/backend/optimizer/path/allpaths.c  |   5 +-
src/backend/optimizer/path/equivclass.c|  61 +++
src/backend/optimizer/path/pathkeys.c  |  19 +
src/backend/optimizer/plan/planner.c   | 116 +++-
src/backend/optimizer/plan/subselect.c |  15 +-
src/backend/optimizer/prep/prepunion.c | 720 +
src/backend/parser/analyze.c   |   3 +-
src/include/nodes/pathnodes.h  |   2 +
src/include/optimizer/paths.h  |   4 +
src/include/optimizer/planner.h|   3 +-
src/include/optimizer/prep.h   |   2 +-
src/test/regress/expected/collate.icu.utf8.out |   2 +
src/test/regress/expected/incremental_sort.out |  13 +-
src/test/regress/expected/union.out|  46 +-
src/test/regress/sql/collate.icu.utf8.sql  |   2 +
src/test/regress/sql/union.sql |  19 +-
18 files changed, 761 insertions(+), 287 deletions(-)