Header And Logo

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

Functions | Variables

dest.c File Reference

#include "postgres.h"
#include "access/printtup.h"
#include "access/xact.h"
#include "commands/copy.h"
#include "commands/createas.h"
#include "commands/matview.h"
#include "executor/functions.h"
#include "executor/tstoreReceiver.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "utils/portal.h"
Include dependency graph for dest.c:

Go to the source code of this file.

Functions

static void donothingReceive (TupleTableSlot *slot, DestReceiver *self)
static void donothingStartup (DestReceiver *self, int operation, TupleDesc typeinfo)
static void donothingCleanup (DestReceiver *self)
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

static DestReceiver donothingDR
static DestReceiver debugtupDR
static DestReceiver spi_printtupDR
DestReceiverNone_Receiver = &donothingDR

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  ) 
static void donothingCleanup ( DestReceiver self  )  [static]

Definition at line 58 of file dest.c.

{
    /* this is used for both shutdown and destroy methods */
}

static void donothingReceive ( TupleTableSlot slot,
DestReceiver self 
) [static]

Definition at line 48 of file dest.c.

{
}

static void donothingStartup ( DestReceiver self,
int  operation,
TupleDesc  typeinfo 
) [static]

Definition at line 53 of file dest.c.

{
}

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

Initial value:
 {
    debugtup, debugStartup, donothingCleanup, donothingCleanup,
    DestDebug
}

Definition at line 72 of file dest.c.

Initial value:
 {
    donothingReceive, donothingStartup, donothingCleanup, donothingCleanup,
    DestNone
}

Definition at line 67 of file dest.c.

Initial value:
 {
    spi_printtup, spi_dest_startup, donothingCleanup, donothingCleanup,
    DestSPI
}

Definition at line 77 of file dest.c.