aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execProcnode.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-09-29 18:21:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-09-29 18:21:41 +0000
commit3a94e789f5c9537d804210be3cb26f7fb08e3b9e (patch)
treef1eac12405e3c0ded881d7dd7e59cec35b30c335 /src/backend/executor/execProcnode.c
parent6f64c2e54a0b14154a335249f4dca91a39c61c50 (diff)
downloadpostgresql-3a94e789f5c9537d804210be3cb26f7fb08e3b9e.tar.gz
postgresql-3a94e789f5c9537d804210be3cb26f7fb08e3b9e.zip
Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.
(Don't forget that an alias is required.) Views reimplemented as expanding to subselect-in-FROM. Grouping, aggregates, DISTINCT in views actually work now (he says optimistically). No UNION support in subselects/views yet, but I have some ideas about that. Rule-related permissions checking moved out of rewriter and into executor. INITDB REQUIRED!
Diffstat (limited to 'src/backend/executor/execProcnode.c')
-rw-r--r--src/backend/executor/execProcnode.c113
1 files changed, 63 insertions, 50 deletions
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c
index 8c9970a6fa7..d6a15371311 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.19 2000/08/13 02:50:03 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.20 2000/09/29 18:21:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -90,6 +90,7 @@
#include "executor/nodeSeqscan.h"
#include "executor/nodeSort.h"
#include "executor/nodeSubplan.h"
+#include "executor/nodeSubqueryscan.h"
#include "executor/nodeUnique.h"
#include "miscadmin.h"
#include "tcop/tcopprot.h"
@@ -153,6 +154,15 @@ ExecInitNode(Plan *node, EState *estate, Plan *parent)
result = ExecInitIndexScan((IndexScan *) node, estate, parent);
break;
+ case T_TidScan:
+ result = ExecInitTidScan((TidScan *) node, estate, parent);
+ break;
+
+ case T_SubqueryScan:
+ result = ExecInitSubqueryScan((SubqueryScan *) node, estate,
+ parent);
+ break;
+
/* ----------------
* join nodes
* ----------------
@@ -165,6 +175,14 @@ ExecInitNode(Plan *node, EState *estate, Plan *parent)
result = ExecInitMergeJoin((MergeJoin *) node, estate, parent);
break;
+ case T_Hash:
+ result = ExecInitHash((Hash *) node, estate, parent);
+ break;
+
+ case T_HashJoin:
+ result = ExecInitHashJoin((HashJoin *) node, estate, parent);
+ break;
+
/* ----------------
* materialization nodes
* ----------------
@@ -189,18 +207,6 @@ ExecInitNode(Plan *node, EState *estate, Plan *parent)
result = ExecInitAgg((Agg *) node, estate, parent);
break;
- case T_Hash:
- result = ExecInitHash((Hash *) node, estate, parent);
- break;
-
- case T_HashJoin:
- result = ExecInitHashJoin((HashJoin *) node, estate, parent);
- break;
-
- case T_TidScan:
- result = ExecInitTidScan((TidScan *) node, estate, parent);
- break;
-
default:
elog(ERROR, "ExecInitNode: node %d unsupported", nodeTag(node));
result = FALSE;
@@ -272,6 +278,14 @@ ExecProcNode(Plan *node, Plan *parent)
result = ExecIndexScan((IndexScan *) node);
break;
+ case T_TidScan:
+ result = ExecTidScan((TidScan *) node);
+ break;
+
+ case T_SubqueryScan:
+ result = ExecSubqueryScan((SubqueryScan *) node);
+ break;
+
/* ----------------
* join nodes
* ----------------
@@ -284,6 +298,14 @@ ExecProcNode(Plan *node, Plan *parent)
result = ExecMergeJoin((MergeJoin *) node);
break;
+ case T_Hash:
+ result = ExecHash((Hash *) node);
+ break;
+
+ case T_HashJoin:
+ result = ExecHashJoin((HashJoin *) node);
+ break;
+
/* ----------------
* materialization nodes
* ----------------
@@ -308,18 +330,6 @@ ExecProcNode(Plan *node, Plan *parent)
result = ExecAgg((Agg *) node);
break;
- case T_Hash:
- result = ExecHash((Hash *) node);
- break;
-
- case T_HashJoin:
- result = ExecHashJoin((HashJoin *) node);
- break;
-
- case T_TidScan:
- result = ExecTidScan((TidScan *) node);
- break;
-
default:
elog(ERROR, "ExecProcNode: node %d unsupported", nodeTag(node));
result = NULL;
@@ -356,6 +366,12 @@ ExecCountSlotsNode(Plan *node)
case T_IndexScan:
return ExecCountSlotsIndexScan((IndexScan *) node);
+ case T_TidScan:
+ return ExecCountSlotsTidScan((TidScan *) node);
+
+ case T_SubqueryScan:
+ return ExecCountSlotsSubqueryScan((SubqueryScan *) node);
+
/* ----------------
* join nodes
* ----------------
@@ -366,6 +382,12 @@ ExecCountSlotsNode(Plan *node)
case T_MergeJoin:
return ExecCountSlotsMergeJoin((MergeJoin *) node);
+ case T_Hash:
+ return ExecCountSlotsHash((Hash *) node);
+
+ case T_HashJoin:
+ return ExecCountSlotsHashJoin((HashJoin *) node);
+
/* ----------------
* materialization nodes
* ----------------
@@ -385,15 +407,6 @@ ExecCountSlotsNode(Plan *node)
case T_Agg:
return ExecCountSlotsAgg((Agg *) node);
- case T_Hash:
- return ExecCountSlotsHash((Hash *) node);
-
- case T_HashJoin:
- return ExecCountSlotsHashJoin((HashJoin *) node);
-
- case T_TidScan:
- return ExecCountSlotsTidScan((TidScan *) node);
-
default:
elog(ERROR, "ExecCountSlotsNode: node not yet supported: %d",
nodeTag(node));
@@ -462,6 +475,14 @@ ExecEndNode(Plan *node, Plan *parent)
ExecEndIndexScan((IndexScan *) node);
break;
+ case T_TidScan:
+ ExecEndTidScan((TidScan *) node);
+ break;
+
+ case T_SubqueryScan:
+ ExecEndSubqueryScan((SubqueryScan *) node);
+ break;
+
/* ----------------
* join nodes
* ----------------
@@ -474,6 +495,14 @@ ExecEndNode(Plan *node, Plan *parent)
ExecEndMergeJoin((MergeJoin *) node);
break;
+ case T_Hash:
+ ExecEndHash((Hash *) node);
+ break;
+
+ case T_HashJoin:
+ ExecEndHashJoin((HashJoin *) node);
+ break;
+
/* ----------------
* materialization nodes
* ----------------
@@ -498,22 +527,6 @@ ExecEndNode(Plan *node, Plan *parent)
ExecEndAgg((Agg *) node);
break;
- /* ----------------
- * XXX add hooks to these
- * ----------------
- */
- case T_Hash:
- ExecEndHash((Hash *) node);
- break;
-
- case T_HashJoin:
- ExecEndHashJoin((HashJoin *) node);
- break;
-
- case T_TidScan:
- ExecEndTidScan((TidScan *) node);
- break;
-
default:
elog(ERROR, "ExecEndNode: node %d unsupported", nodeTag(node));
break;