aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes/execnodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-10-05 19:11:39 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-10-05 19:11:39 +0000
commit05e3d0ee8666b74f11ffad16f46e372459d6e53e (patch)
treeb273892bfda60f6bad315e84aaa2e9826e226931 /src/include/nodes/execnodes.h
parent5292637f52c6db8a22f99177f228273cb69fc510 (diff)
downloadpostgresql-05e3d0ee8666b74f11ffad16f46e372459d6e53e.tar.gz
postgresql-05e3d0ee8666b74f11ffad16f46e372459d6e53e.zip
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!
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r--src/include/nodes/execnodes.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 65d35a2977e..06de4be54cb 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: execnodes.h,v 1.50 2000/09/29 18:21:38 tgl Exp $
+ * $Id: execnodes.h,v 1.51 2000/10/05 19:11:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -348,7 +348,6 @@ typedef struct ResultState
* whichplan which plan is being executed
* nplans how many plans are in the list
* initialized array of ExecInitNode() results
- * rtentries range table for the current plan
* result_relation_info_list array of each subplan's result relation info
* junkFilter_list array of each subplan's junk filter
* ----------------
@@ -359,7 +358,6 @@ typedef struct AppendState
int as_whichplan;
int as_nplans;
bool *as_initialized;
- List *as_rtentries;
List *as_result_relation_info_list;
List *as_junkFilter_list;
} AppendState;
@@ -460,14 +458,12 @@ typedef struct TidScanState
* The sub-query will have its own EState, which we save here.
* ScanTupleSlot references the current output tuple of the sub-query.
*
- * SubQueryDesc queryDesc for sub-query
* SubEState exec state for sub-query
* ----------------
*/
typedef struct SubqueryScanState
{
CommonScanState csstate; /* its first field is NodeTag */
- struct QueryDesc *sss_SubQueryDesc;
EState *sss_SubEState;
} SubqueryScanState;
@@ -659,6 +655,26 @@ typedef struct UniqueState
MemoryContext tempContext; /* short-term context for comparisons */
} UniqueState;
+/* ----------------
+ * SetOpState information
+ *
+ * SetOp nodes are used "on top of" sort nodes to discard
+ * duplicate tuples returned from the sort phase. These are
+ * more complex than a simple Unique since we have to count
+ * how many duplicates to return.
+ * ----------------
+ */
+typedef struct SetOpState
+{
+ CommonState cstate; /* its first field is NodeTag */
+ FmgrInfo *eqfunctions; /* per-field lookup data for equality fns */
+ bool subplan_done; /* has subplan returned EOF? */
+ long numLeft; /* number of left-input dups of cur group */
+ long numRight; /* number of right-input dups of cur group */
+ long numOutput; /* number of dups left to output */
+ MemoryContext tempContext; /* short-term context for comparisons */
+} SetOpState;
+
/* ----------------
* HashState information