| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Give a good error message when we can neither hash nor sort a UN |
| Date: | 2026-11-19 20:49:12 |
| Message-ID: | E1xU94B-00000000QYL-0inm@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Give a good error message when we can neither hash nor sort a UNION.
Prior to v17 we said
ERROR: could not implement UNION
DETAIL: Some of the datatypes only support hashing, while others only support sorting.
but this check got lost in refactoring, leading to a much less helpful
message. Put it back (in generate_union_paths). Also add a couple of
comparable checks in other places that seem like they could be
vulnerable to this problem, and add some test coverage.
Bug: #19916
Reported-by: Robins Tharakan <tharakan(at)gmail(dot)com>
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/19916-8097ca71b8aa4085@postgresql.org
Backpatch-through: 17
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/7b4f814b8042f8bf9d7e2943181ea825c7cdf5ce
Modified Files
--------------
src/backend/optimizer/path/allpaths.c | 11 +++++++++++
src/backend/optimizer/plan/planner.c | 14 ++++++++++++++
src/backend/optimizer/prep/prepunion.c | 13 +++++++++++++
src/test/regress/expected/union.out | 17 +++++++++++++++++
src/test/regress/sql/union.sql | 8 ++++++++
5 files changed, 63 insertions(+)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melanie Plageman | 2026-11-19 21:03:40 | pgsql: Fix WAL-logged CREATE DATABASE with nonstandard pages |
| Previous Message | Robert Haas | 2026-11-19 20:35:49 | Re: pgsql: ci: Enable PCH in mingw cross job |