Header And Logo

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

Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

dest.h File Reference

#include "executor/tuptable.h"
Include dependency graph for dest.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _DestReceiver

Defines

#define COMPLETION_TAG_BUFSIZE   64

Typedefs

typedef struct _DestReceiver DestReceiver

Enumerations

enum  CommandDest {
  DestNone, DestDebug, DestRemote, DestRemoteExecute,
  DestSPI, DestTuplestore, DestIntoRel, DestCopyOut,
  DestSQLFunction, DestTransientRel
}

Functions

void BeginCommand (const char *commandTag, CommandDest dest)
DestReceiverCreateDestReceiver (CommandDest dest)
void EndCommand (const char *commandTag, CommandDest dest)
void NullCommand (CommandDest dest)
void ReadyForQuery (CommandDest dest)

Variables

DestReceiverNone_Receiver

Define Documentation

#define COMPLETION_TAG_BUFSIZE   64

Typedef Documentation

typedef struct _DestReceiver DestReceiver

Definition at line 109 of file dest.h.


Enumeration Type Documentation

Enumerator:
DestNone 
DestDebug 
DestRemote 
DestRemoteExecute 
DestSPI 
DestTuplestore 
DestIntoRel 
DestCopyOut 
DestSQLFunction 
DestTransientRel 

Definition at line 86 of file dest.h.

{
    DestNone,                   /* results are discarded */
    DestDebug,                  /* results go to debugging output */
    DestRemote,                 /* results sent to frontend process */
    DestRemoteExecute,          /* sent to frontend, in Execute command */
    DestSPI,                    /* results sent to SPI manager */
    DestTuplestore,             /* results sent to Tuplestore */
    DestIntoRel,                /* results sent to relation (SELECT INTO) */
    DestCopyOut,                /* results sent to COPY TO code */
    DestSQLFunction,            /* results sent to SQL-language func mgr */
    DestTransientRel            /* results sent to transient relation */
} CommandDest;


Function Documentation

void BeginCommand ( const char *  commandTag,
CommandDest  dest 
)

Definition at line 91 of file dest.c.

Referenced by exec_execute_message(), and exec_simple_query().

{
    /* Nothing to do at present */
}

DestReceiver* CreateDestReceiver ( CommandDest  dest  ) 
void EndCommand ( const char *  commandTag,
CommandDest  dest 
)

Definition at line 143 of file dest.c.

References DestCopyOut, DestDebug, DestIntoRel, DestNone, DestRemote, DestRemoteExecute, DestSPI, DestSQLFunction, DestTransientRel, DestTuplestore, and pq_putmessage().

Referenced by exec_execute_message(), exec_replication_command(), exec_simple_query(), and WalSndLoop().

{
    switch (dest)
    {
        case DestRemote:
        case DestRemoteExecute:

            /*
             * We assume the commandTag is plain ASCII and therefore requires
             * no encoding conversion.
             */
            pq_putmessage('C', commandTag, strlen(commandTag) + 1);
            break;

        case DestNone:
        case DestDebug:
        case DestSPI:
        case DestTuplestore:
        case DestIntoRel:
        case DestCopyOut:
        case DestSQLFunction:
        case DestTransientRel:
            break;
    }
}

void NullCommand ( CommandDest  dest  ) 

Definition at line 182 of file dest.c.

References DestCopyOut, DestDebug, DestIntoRel, DestNone, DestRemote, DestRemoteExecute, DestSPI, DestSQLFunction, DestTransientRel, DestTuplestore, FrontendProtocol, PG_PROTOCOL_MAJOR, pq_putemptymessage(), and pq_putmessage().

Referenced by exec_execute_message(), and exec_simple_query().

{
    switch (dest)
    {
        case DestRemote:
        case DestRemoteExecute:

            /*
             * tell the fe that we saw an empty query string.  In protocols
             * before 3.0 this has a useless empty-string message body.
             */
            if (PG_PROTOCOL_MAJOR(FrontendProtocol) >= 3)
                pq_putemptymessage('I');
            else
                pq_putmessage('I', "", 1);
            break;

        case DestNone:
        case DestDebug:
        case DestSPI:
        case DestTuplestore:
        case DestIntoRel:
        case DestCopyOut:
        case DestSQLFunction:
        case DestTransientRel:
            break;
    }
}

void ReadyForQuery ( CommandDest  dest  ) 

Variable Documentation