summaryrefslogtreecommitdiff
path: root/src/backend/parser/analyze.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-02-20 17:32:18 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-02-20 17:32:18 +0000
commit9cbd0c155d1602aad879f510256b626c58942080 (patch)
tree6d5504a4e841313d3a29cead80067006dc408e39 /src/backend/parser/analyze.c
parent71b0cf2f6bec3129f2c3f574d4e47408c2dc2516 (diff)
downloadpostgresql-9cbd0c155d1602aad879f510256b626c58942080.tar.gz
Remove the Query structure from the executor's API. This allows us to stop
storing mostly-redundant Query trees in prepared statements, portals, etc. To replace Query, a new node type called PlannedStmt is inserted by the planner at the top of a completed plan tree; this carries just the fields of Query that are still needed at runtime. The statement lists kept in portals etc. now consist of intermixed PlannedStmt and bare utility-statement nodes --- no Query. This incidentally allows us to remove some fields from Query and Plan nodes that shouldn't have been there in the first place. Still to do: simplify the execution-time range table; at the moment the range table passed to the executor still contains Query trees for subqueries. initdb forced due to change of stored rules.
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r--src/backend/parser/analyze.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 0eb81d6d89..63a5999a40 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.360 2007/02/01 19:10:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.361 2007/02/20 17:32:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2143,11 +2143,8 @@ transformSelectStmt(ParseState *pstate, SelectStmt *stmt)
if (stmt->into)
{
qry->into = stmt->into;
- if (stmt->intoColNames)
- applyColumnNames(qry->targetList, stmt->intoColNames);
- qry->intoOptions = copyObject(stmt->intoOptions);
- qry->intoOnCommit = stmt->intoOnCommit;
- qry->intoTableSpaceName = stmt->intoTableSpaceName;
+ if (stmt->into->colNames)
+ applyColumnNames(qry->targetList, stmt->into->colNames);
}
qry->rtable = pstate->p_rtable;
@@ -2315,11 +2312,8 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt)
if (stmt->into)
{
qry->into = stmt->into;
- if (stmt->intoColNames)
- applyColumnNames(qry->targetList, stmt->intoColNames);
- qry->intoOptions = copyObject(stmt->intoOptions);
- qry->intoOnCommit = stmt->intoOnCommit;
- qry->intoTableSpaceName = stmt->intoTableSpaceName;
+ if (stmt->into->colNames)
+ applyColumnNames(qry->targetList, stmt->into->colNames);
}
/*
@@ -2399,9 +2393,7 @@ transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt)
/*
* Find leftmost leaf SelectStmt; extract the one-time-only items from it
- * and from the top-level node. (Most of the INTO options can be
- * transferred to the Query immediately, but intoColNames has to be saved
- * to apply below.)
+ * and from the top-level node.
*/
leftmostSelect = stmt->larg;
while (leftmostSelect && leftmostSelect->op != SETOP_NONE)
@@ -2411,10 +2403,7 @@ transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt)
if (leftmostSelect->into)
{
qry->into = leftmostSelect->into;
- intoColNames = leftmostSelect->intoColNames;
- qry->intoOptions = copyObject(leftmostSelect->intoOptions);
- qry->intoOnCommit = leftmostSelect->intoOnCommit;
- qry->intoTableSpaceName = leftmostSelect->intoTableSpaceName;
+ intoColNames = leftmostSelect->into->colNames;
}
/* clear this to prevent complaints in transformSetOperationTree() */