~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-updates

« back to all changes in this revision

Viewing changes to src/include/executor/execdesc.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * execdesc.h
 
4
 *        plan and query descriptor accessor macros used by the executor
 
5
 *        and related modules.
 
6
 *
 
7
 *
 
8
 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
 
9
 * Portions Copyright (c) 1994, Regents of the University of California
 
10
 *
 
11
 * $PostgreSQL$
 
12
 *
 
13
 *-------------------------------------------------------------------------
 
14
 */
 
15
#ifndef EXECDESC_H
 
16
#define EXECDESC_H
 
17
 
 
18
#include "nodes/execnodes.h"
 
19
#include "nodes/plannodes.h"
 
20
#include "tcop/dest.h"
 
21
 
 
22
 
 
23
/* ----------------
 
24
 *              query descriptor:
 
25
 *
 
26
 *      a QueryDesc encapsulates everything that the executor
 
27
 *      needs to execute the query.
 
28
 *
 
29
 *      For the convenience of SQL-language functions, we also support QueryDescs
 
30
 *      containing utility statements; these must not be passed to the executor
 
31
 *      however.
 
32
 * ---------------------
 
33
 */
 
34
typedef struct QueryDesc
 
35
{
 
36
        /* These fields are provided by CreateQueryDesc */
 
37
        CmdType         operation;              /* CMD_SELECT, CMD_UPDATE, etc. */
 
38
        PlannedStmt *plannedstmt;       /* planner's output, or null if utility */
 
39
        Node       *utilitystmt;        /* utility statement, or null */
 
40
        const char *sourceText;         /* source text of the query */
 
41
        Snapshot        snapshot;               /* snapshot to use for query */
 
42
        Snapshot        crosscheck_snapshot;    /* crosscheck for RI update/delete */
 
43
        DestReceiver *dest;                     /* the destination for tuple output */
 
44
        ParamListInfo params;           /* param values being passed in */
 
45
        bool            doInstrument;   /* TRUE requests runtime instrumentation */
 
46
 
 
47
        /* These fields are set by ExecutorStart */
 
48
        TupleDesc       tupDesc;                /* descriptor for result tuples */
 
49
        EState     *estate;                     /* executor's query-wide state */
 
50
        PlanState  *planstate;          /* tree of per-plan-node state */
 
51
 
 
52
        /* This is always set NULL by the core system, but plugins can change it */
 
53
        struct Instrumentation *totaltime;      /* total time spent in ExecutorRun */
 
54
} QueryDesc;
 
55
 
 
56
/* in pquery.c */
 
57
extern QueryDesc *CreateQueryDesc(PlannedStmt *plannedstmt,
 
58
                                const char *sourceText,
 
59
                                Snapshot snapshot,
 
60
                                Snapshot crosscheck_snapshot,
 
61
                                DestReceiver *dest,
 
62
                                ParamListInfo params,
 
63
                                bool doInstrument);
 
64
 
 
65
extern QueryDesc *CreateUtilityQueryDesc(Node *utilitystmt,
 
66
                                           const char *sourceText,
 
67
                                           Snapshot snapshot,
 
68
                                           DestReceiver *dest,
 
69
                                           ParamListInfo params);
 
70
 
 
71
extern void FreeQueryDesc(QueryDesc *qdesc);
 
72
 
 
73
#endif   /* EXECDESC_H  */