1 /*-------------------------------------------------------------------------
4 * plan and query descriptor accessor macros used by the executor
8 * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
9 * Portions Copyright (c) 1994, Regents of the University of California
11 * $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.31 2006/03/05 15:58:56 momjian Exp $
13 *-------------------------------------------------------------------------
18 #include "nodes/parsenodes.h"
19 #include "nodes/execnodes.h"
20 #include "tcop/dest.h"
26 * a QueryDesc encapsulates everything that the executor
27 * needs to execute the query
28 * ---------------------
30 typedef struct QueryDesc
32 /* These fields are provided by CreateQueryDesc */
33 CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */
34 Query *parsetree; /* rewritten parsetree */
35 Plan *plantree; /* planner's output */
36 Snapshot snapshot; /* snapshot to use for query */
37 Snapshot crosscheck_snapshot; /* crosscheck for RI update/delete */
38 DestReceiver *dest; /* the destination for tuple output */
39 ParamListInfo params; /* param values being passed in */
40 bool doInstrument; /* TRUE requests runtime instrumentation */
42 /* These fields are set by ExecutorStart */
43 TupleDesc tupDesc; /* descriptor for result tuples */
44 EState *estate; /* executor's query-wide state */
45 PlanState *planstate; /* tree of per-plan-node state */
49 extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree,
51 Snapshot crosscheck_snapshot,
56 extern void FreeQueryDesc(QueryDesc *qdesc);
58 #endif /* EXECDESC_H */