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 <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/882881ac1aa66144be11a52d4aff982baf6f30d0

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(+)

Reply via email to