From 05e3d0ee8666b74f11ffad16f46e372459d6e53e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 5 Oct 2000 19:11:39 +0000 Subject: Reimplementation of UNION/INTERSECT/EXCEPT. INTERSECT/EXCEPT now meet the SQL92 semantics, including support for ALL option. All three can be used in subqueries and views. DISTINCT and ORDER BY work now in views, too. This rewrite fixes many problems with cross-datatype UNIONs and INSERT/SELECT where the SELECT yields different datatypes than the INSERT needs. I did that by making UNION subqueries and SELECT in INSERT be treated like subselects-in-FROM, thereby allowing an extra level of targetlist where the datatype conversions can be inserted safely. INITDB NEEDED! --- src/backend/executor/execProcnode.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/backend/executor/execProcnode.c') diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c index d6a15371311..6269a7caa10 100644 --- a/src/backend/executor/execProcnode.c +++ b/src/backend/executor/execProcnode.c @@ -12,7 +12,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.20 2000/09/29 18:21:29 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.21 2000/10/05 19:11:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -88,6 +88,7 @@ #include "executor/nodeNestloop.h" #include "executor/nodeResult.h" #include "executor/nodeSeqscan.h" +#include "executor/nodeSetOp.h" #include "executor/nodeSort.h" #include "executor/nodeSubplan.h" #include "executor/nodeSubqueryscan.h" @@ -199,6 +200,10 @@ ExecInitNode(Plan *node, EState *estate, Plan *parent) result = ExecInitUnique((Unique *) node, estate, parent); break; + case T_SetOp: + result = ExecInitSetOp((SetOp *) node, estate, parent); + break; + case T_Group: result = ExecInitGroup((Group *) node, estate, parent); break; @@ -322,6 +327,10 @@ ExecProcNode(Plan *node, Plan *parent) result = ExecUnique((Unique *) node); break; + case T_SetOp: + result = ExecSetOp((SetOp *) node); + break; + case T_Group: result = ExecGroup((Group *) node); break; @@ -401,6 +410,9 @@ ExecCountSlotsNode(Plan *node) case T_Unique: return ExecCountSlotsUnique((Unique *) node); + case T_SetOp: + return ExecCountSlotsSetOp((SetOp *) node); + case T_Group: return ExecCountSlotsGroup((Group *) node); @@ -519,6 +531,10 @@ ExecEndNode(Plan *node, Plan *parent) ExecEndUnique((Unique *) node); break; + case T_SetOp: + ExecEndSetOp((SetOp *) node); + break; + case T_Group: ExecEndGroup((Group *) node); break; -- cgit v1.2.3