1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* execdesc.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* plan and query descriptor accessor macros used by the executor
|
|
|
|
* and related modules.
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
2006-03-05 16:59:11 +01:00
|
|
|
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2006-07-11 18:35:33 +02:00
|
|
|
* $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.32 2006/07/11 16:35:33 momjian Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef EXECDESC_H
|
|
|
|
#define EXECDESC_H
|
|
|
|
|
2002-12-05 16:50:39 +01:00
|
|
|
#include "nodes/execnodes.h"
|
2006-07-11 18:35:33 +02:00
|
|
|
#include "nodes/parsenodes.h"
|
1999-07-16 19:07:40 +02:00
|
|
|
#include "tcop/dest.h"
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2002-02-27 20:36:13 +01:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* query descriptor:
|
2002-12-05 16:50:39 +01:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* a QueryDesc encapsulates everything that the executor
|
|
|
|
* needs to execute the query
|
1996-07-09 08:22:35 +02:00
|
|
|
* ---------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef struct QueryDesc
|
|
|
|
{
|
2002-12-05 16:50:39 +01:00
|
|
|
/* These fields are provided by CreateQueryDesc */
|
1997-09-08 04:41:22 +02:00
|
|
|
CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */
|
2002-12-05 16:50:39 +01:00
|
|
|
Query *parsetree; /* rewritten parsetree */
|
|
|
|
Plan *plantree; /* planner's output */
|
2004-09-13 22:10:13 +02:00
|
|
|
Snapshot snapshot; /* snapshot to use for query */
|
|
|
|
Snapshot crosscheck_snapshot; /* crosscheck for RI update/delete */
|
2003-05-06 22:26:28 +02:00
|
|
|
DestReceiver *dest; /* the destination for tuple output */
|
2002-12-05 16:50:39 +01:00
|
|
|
ParamListInfo params; /* param values being passed in */
|
|
|
|
bool doInstrument; /* TRUE requests runtime instrumentation */
|
2002-02-27 20:36:13 +01:00
|
|
|
|
2002-12-05 16:50:39 +01:00
|
|
|
/* These fields are set by ExecutorStart */
|
|
|
|
TupleDesc tupDesc; /* descriptor for result tuples */
|
|
|
|
EState *estate; /* executor's query-wide state */
|
|
|
|
PlanState *planstate; /* tree of per-plan-node state */
|
1997-09-08 23:56:23 +02:00
|
|
|
} QueryDesc;
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* in pquery.c */
|
1998-09-01 06:40:42 +02:00
|
|
|
extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree,
|
2004-09-13 22:10:13 +02:00
|
|
|
Snapshot snapshot,
|
|
|
|
Snapshot crosscheck_snapshot,
|
2003-08-04 02:43:34 +02:00
|
|
|
DestReceiver *dest,
|
|
|
|
ParamListInfo params,
|
|
|
|
bool doInstrument);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2002-12-15 17:17:59 +01:00
|
|
|
extern void FreeQueryDesc(QueryDesc *qdesc);
|
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* EXECDESC_H */
|