summaryrefslogtreecommitdiff
path: root/src/include/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/executor')
-rw-r--r--src/include/executor/execdesc.h21
-rw-r--r--src/include/executor/executor.h3
-rw-r--r--src/include/executor/spi_priv.h11
3 files changed, 23 insertions, 12 deletions
diff --git a/src/include/executor/execdesc.h b/src/include/executor/execdesc.h
index cf991125d4..d5ae745a29 100644
--- a/src/include/executor/execdesc.h
+++ b/src/include/executor/execdesc.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.33 2007/01/05 22:19:54 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.34 2007/02/20 17:32:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,7 +16,7 @@
#define EXECDESC_H
#include "nodes/execnodes.h"
-#include "nodes/parsenodes.h"
+#include "nodes/plannodes.h"
#include "tcop/dest.h"
@@ -24,15 +24,19 @@
* query descriptor:
*
* a QueryDesc encapsulates everything that the executor
- * needs to execute the query
+ * needs to execute the query.
+ *
+ * For the convenience of SQL-language functions, we also support QueryDescs
+ * containing utility statements; these must not be passed to the executor
+ * however.
* ---------------------
*/
typedef struct QueryDesc
{
/* These fields are provided by CreateQueryDesc */
CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */
- Query *parsetree; /* rewritten parsetree */
- Plan *plantree; /* planner's output */
+ PlannedStmt *plannedstmt; /* planner's output, or null if utility */
+ Node *utilitystmt; /* utility statement, or null */
Snapshot snapshot; /* snapshot to use for query */
Snapshot crosscheck_snapshot; /* crosscheck for RI update/delete */
DestReceiver *dest; /* the destination for tuple output */
@@ -46,13 +50,18 @@ typedef struct QueryDesc
} QueryDesc;
/* in pquery.c */
-extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree,
+extern QueryDesc *CreateQueryDesc(PlannedStmt *plannedstmt,
Snapshot snapshot,
Snapshot crosscheck_snapshot,
DestReceiver *dest,
ParamListInfo params,
bool doInstrument);
+extern QueryDesc *CreateUtilityQueryDesc(Node *utilitystmt,
+ Snapshot snapshot,
+ DestReceiver *dest,
+ ParamListInfo params);
+
extern void FreeQueryDesc(QueryDesc *qdesc);
#endif /* EXECDESC_H */
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index bfbe1ba2f3..38260b5ecd 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.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/executor/executor.h,v 1.136 2007/02/06 02:59:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.137 2007/02/20 17:32:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,7 @@
#define EXECUTOR_H
#include "executor/execdesc.h"
+#include "nodes/parsenodes.h"
/*
diff --git a/src/include/executor/spi_priv.h b/src/include/executor/spi_priv.h
index 3bfc870159..5e65bd750a 100644
--- a/src/include/executor/spi_priv.h
+++ b/src/include/executor/spi_priv.h
@@ -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/include/executor/spi_priv.h,v 1.26 2007/01/05 22:19:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/executor/spi_priv.h,v 1.27 2007/02/20 17:32:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -35,10 +35,11 @@ typedef struct
MemoryContext plancxt;
/* Original query string (used for error reporting) */
const char *query;
- /* List of List of querytrees; one sublist per original parsetree */
- List *qtlist;
- /* List of plan trees --- length == # of querytrees, but flat list */
- List *ptlist;
+ /*
+ * List of List of PlannedStmts and utility stmts; one sublist per
+ * original parsetree
+ */
+ List *stmt_list_list;
/* Argument types, if a prepared plan */
int nargs;
Oid *argtypes;