Header And Logo

PostgreSQL
| The world's most advanced open source database.

Data Structures | Typedefs | Functions

execdesc.h File Reference

#include "nodes/execnodes.h"
#include "tcop/dest.h"
Include dependency graph for execdesc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  QueryDesc

Typedefs

typedef struct QueryDesc QueryDesc

Functions

QueryDescCreateQueryDesc (PlannedStmt *plannedstmt, const char *sourceText, Snapshot snapshot, Snapshot crosscheck_snapshot, DestReceiver *dest, ParamListInfo params, int instrument_options)
QueryDescCreateUtilityQueryDesc (Node *utilitystmt, const char *sourceText, Snapshot snapshot, DestReceiver *dest, ParamListInfo params)
void FreeQueryDesc (QueryDesc *qdesc)

Typedef Documentation

typedef struct QueryDesc QueryDesc

Function Documentation

QueryDesc* CreateQueryDesc ( PlannedStmt plannedstmt,
const char *  sourceText,
Snapshot  snapshot,
Snapshot  crosscheck_snapshot,
DestReceiver dest,
ParamListInfo  params,
int  instrument_options 
)

Definition at line 62 of file pquery.c.

References PlannedStmt::commandType, QueryDesc::crosscheck_snapshot, QueryDesc::dest, QueryDesc::estate, QueryDesc::instrument_options, QueryDesc::operation, palloc(), QueryDesc::params, QueryDesc::plannedstmt, QueryDesc::planstate, RegisterSnapshot(), QueryDesc::snapshot, QueryDesc::sourceText, QueryDesc::totaltime, QueryDesc::tupDesc, PlannedStmt::utilityStmt, and QueryDesc::utilitystmt.

Referenced by _SPI_execute_plan(), BeginCopy(), ExecCreateTableAs(), execute_sql_string(), ExplainOnePlan(), PortalStart(), postquel_start(), ProcessQuery(), and refresh_matview_datafill().

{
    QueryDesc  *qd = (QueryDesc *) palloc(sizeof(QueryDesc));

    qd->operation = plannedstmt->commandType;   /* operation */
    qd->plannedstmt = plannedstmt;      /* plan */
    qd->utilitystmt = plannedstmt->utilityStmt; /* in case DECLARE CURSOR */
    qd->sourceText = sourceText;    /* query text */
    qd->snapshot = RegisterSnapshot(snapshot);  /* snapshot */
    /* RI check snapshot */
    qd->crosscheck_snapshot = RegisterSnapshot(crosscheck_snapshot);
    qd->dest = dest;            /* output dest */
    qd->params = params;        /* parameter values passed into query */
    qd->instrument_options = instrument_options;        /* instrumentation
                                                         * wanted? */

    /* null these fields until set by ExecutorStart */
    qd->tupDesc = NULL;
    qd->estate = NULL;
    qd->planstate = NULL;
    qd->totaltime = NULL;

    return qd;
}

QueryDesc* CreateUtilityQueryDesc ( Node utilitystmt,
const char *  sourceText,
Snapshot  snapshot,
DestReceiver dest,
ParamListInfo  params 
)

Definition at line 97 of file pquery.c.

References QueryDesc::crosscheck_snapshot, QueryDesc::dest, QueryDesc::estate, QueryDesc::instrument_options, QueryDesc::operation, palloc(), QueryDesc::params, QueryDesc::plannedstmt, QueryDesc::planstate, RegisterSnapshot(), QueryDesc::snapshot, QueryDesc::sourceText, QueryDesc::totaltime, QueryDesc::tupDesc, and QueryDesc::utilitystmt.

Referenced by postquel_start().

{
    QueryDesc  *qd = (QueryDesc *) palloc(sizeof(QueryDesc));

    qd->operation = CMD_UTILITY;    /* operation */
    qd->plannedstmt = NULL;
    qd->utilitystmt = utilitystmt;      /* utility command */
    qd->sourceText = sourceText;    /* query text */
    qd->snapshot = RegisterSnapshot(snapshot);  /* snapshot */
    qd->crosscheck_snapshot = InvalidSnapshot;  /* RI check snapshot */
    qd->dest = dest;            /* output dest */
    qd->params = params;        /* parameter values passed into query */
    qd->instrument_options = false;     /* uninteresting for utilities */

    /* null these fields until set by ExecutorStart */
    qd->tupDesc = NULL;
    qd->estate = NULL;
    qd->planstate = NULL;
    qd->totaltime = NULL;

    return qd;
}

void FreeQueryDesc ( QueryDesc qdesc  )