mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
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!
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user