aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/optimizer/prep/prepunion.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c
index 2e55131a591..e80ad7753de 100644
--- a/src/backend/optimizer/prep/prepunion.c
+++ b/src/backend/optimizer/prep/prepunion.c
@@ -594,12 +594,13 @@ generate_nonunion_plan(SetOperationStmt *op, PlannerInfo *root,
/* Identify the grouping semantics */
groupList = generate_setop_grouplist(op, tlist);
- /* punt if nothing to group on (can this happen?) */
+ /* punt if nothing to group on (not worth fixing in back branches) */
if (groupList == NIL)
- {
- *sortClauses = NIL;
- return plan;
- }
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ /* translator: %s is UNION, INTERSECT, or EXCEPT */
+ errmsg("%s over no columns is not supported",
+ (op->op == SETOP_INTERSECT) ? "INTERSECT" : "EXCEPT")));
/*
* Estimate number of distinct groups that we'll need hashtable entries
@@ -738,12 +739,12 @@ make_union_unique(SetOperationStmt *op, Plan *plan,
/* Identify the grouping semantics */
groupList = generate_setop_grouplist(op, plan->targetlist);
- /* punt if nothing to group on (can this happen?) */
+ /* punt if nothing to group on (not worth fixing in back branches) */
if (groupList == NIL)
- {
- *sortClauses = NIL;
- return plan;
- }
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ /* translator: %s is UNION, INTERSECT, or EXCEPT */
+ errmsg("%s over no columns is not supported", "UNION")));
/*
* XXX for the moment, take the number of distinct groups as equal to the