summaryrefslogtreecommitdiff
path: root/src/include/tcop
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/include/tcop
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/include/tcop')
-rw-r--r--src/include/tcop/pquery.h7
-rw-r--r--src/include/tcop/tcopprot.h5
-rw-r--r--src/include/tcop/utility.h10
3 files changed, 10 insertions, 12 deletions
diff --git a/src/include/tcop/pquery.h b/src/include/tcop/pquery.h
index 3531353027..5cab498c13 100644
--- a/src/include/tcop/pquery.h
+++ b/src/include/tcop/pquery.h
@@ -7,23 +7,26 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/tcop/pquery.h,v 1.40 2007/01/05 22:19:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/tcop/pquery.h,v 1.41 2007/02/20 17:32:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PQUERY_H
#define PQUERY_H
+#include "nodes/parsenodes.h"
#include "utils/portal.h"
extern DLLIMPORT Portal ActivePortal;
-extern PortalStrategy ChoosePortalStrategy(List *parseTrees);
+extern PortalStrategy ChoosePortalStrategy(List *stmts);
extern List *FetchPortalTargetList(Portal portal);
+extern List *FetchStatementTargetList(Node *stmt);
+
extern void PortalStart(Portal portal, ParamListInfo params,
Snapshot snapshot);
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
index ad66a61dac..2a55125576 100644
--- a/src/include/tcop/tcopprot.h
+++ b/src/include/tcop/tcopprot.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.86 2007/01/05 22:19:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.87 2007/02/20 17:32:17 tgl Exp $
*
* OLD COMMENTS
* This file was created so that other c files could get the two
@@ -20,6 +20,7 @@
#define TCOPPROT_H
#include "executor/execdesc.h"
+#include "nodes/parsenodes.h"
#include "utils/guc.h"
@@ -50,7 +51,7 @@ extern List *pg_parse_and_rewrite(const char *query_string,
extern List *pg_parse_query(const char *query_string);
extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
Oid *paramTypes, int numParams);
-extern Plan *pg_plan_query(Query *querytree, ParamListInfo boundParams);
+extern PlannedStmt *pg_plan_query(Query *querytree, ParamListInfo boundParams);
extern List *pg_plan_queries(List *querytrees, ParamListInfo boundParams,
bool needSnapshot);
diff --git a/src/include/tcop/utility.h b/src/include/tcop/utility.h
index ebcaf59772..52c0225306 100644
--- a/src/include/tcop/utility.h
+++ b/src/include/tcop/utility.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/tcop/utility.h,v 1.30 2007/01/05 22:19:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/tcop/utility.h,v 1.31 2007/02/20 17:32:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,15 +26,9 @@ extern TupleDesc UtilityTupleDescriptor(Node *parsetree);
extern const char *CreateCommandTag(Node *parsetree);
-extern const char *CreateQueryTag(Query *parsetree);
-
extern LogStmtLevel GetCommandLogLevel(Node *parsetree);
-extern LogStmtLevel GetQueryLogLevel(Query *parsetree);
-
-extern bool QueryReturnsTuples(Query *parsetree);
-
-extern bool QueryIsReadOnly(Query *parsetree);
+extern bool CommandIsReadOnly(Node *parsetree);
extern void CheckRelationOwnership(RangeVar *rel, bool noCatalogs);