#include "executor/tuptable.h"

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) |
| DestReceiver * | CreateDestReceiver (CommandDest dest) |
| void | EndCommand (const char *commandTag, CommandDest dest) |
| void | NullCommand (CommandDest dest) |
| void | ReadyForQuery (CommandDest dest) |
Variables | |
| DestReceiver * | None_Receiver |
| #define COMPLETION_TAG_BUFSIZE 64 |
Definition at line 74 of file dest.h.
Referenced by ExecCreateTableAs(), PerformPortalFetch(), PortalRun(), ProcessQuery(), and standard_ProcessUtility().
| typedef struct _DestReceiver DestReceiver |
| enum CommandDest |
| 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;
| 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 | ) |
Definition at line 101 of file dest.c.
References CreateCopyDestReceiver(), CreateIntoRelDestReceiver(), CreateSQLFunctionDestReceiver(), CreateTransientRelDestReceiver(), CreateTuplestoreDestReceiver(), DestCopyOut, DestDebug, DestIntoRel, DestNone, DestRemote, DestRemoteExecute, DestSPI, DestSQLFunction, DestTransientRel, DestTuplestore, InvalidOid, NULL, and printtup_create_DR().
Referenced by _SPI_execute_plan(), BeginCopy(), exec_execute_message(), exec_simple_query(), execute_sql_string(), FillPortalStore(), PersistHoldablePortal(), postquel_start(), SPI_cursor_fetch(), and SPI_scroll_cursor_fetch().
{
switch (dest)
{
case DestRemote:
case DestRemoteExecute:
return printtup_create_DR(dest);
case DestNone:
return &donothingDR;
case DestDebug:
return &debugtupDR;
case DestSPI:
return &spi_printtupDR;
case DestTuplestore:
return CreateTuplestoreDestReceiver();
case DestIntoRel:
return CreateIntoRelDestReceiver(NULL);
case DestCopyOut:
return CreateCopyDestReceiver();
case DestSQLFunction:
return CreateSQLFunctionDestReceiver();
case DestTransientRel:
return CreateTransientRelDestReceiver(InvalidOid);
}
/* should never get here */
return &donothingDR;
}
| 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 | ) |
Definition at line 223 of file dest.c.
References buf, DestCopyOut, DestDebug, DestIntoRel, DestNone, DestRemote, DestRemoteExecute, DestSPI, DestSQLFunction, DestTransientRel, DestTuplestore, FrontendProtocol, PG_PROTOCOL_MAJOR, pq_beginmessage(), pq_endmessage(), pq_flush(), pq_putemptymessage(), pq_sendbyte(), and TransactionBlockStatusCode().
Referenced by PostgresMain().
{
switch (dest)
{
case DestRemote:
case DestRemoteExecute:
if (PG_PROTOCOL_MAJOR(FrontendProtocol) >= 3)
{
StringInfoData buf;
pq_beginmessage(&buf, 'Z');
pq_sendbyte(&buf, TransactionBlockStatusCode());
pq_endmessage(&buf);
}
else if (PG_PROTOCOL_MAJOR(FrontendProtocol) >= 2)
pq_putemptymessage('Z');
/* Flush output at end of cycle in any case. */
pq_flush();
break;
case DestNone:
case DestDebug:
case DestSPI:
case DestTuplestore:
case DestIntoRel:
case DestCopyOut:
case DestSQLFunction:
case DestTransientRel:
break;
}
}
Definition at line 83 of file dest.c.
Referenced by ConvertTriggerToFK(), CreateSchemaCommand(), DoPortalRunFetch(), ExplainOnePlan(), FillPortalStore(), PerformPortalFetch(), PortalRunMulti(), PortalStart(), postquel_start(), ProcessUtilitySlow(), SPI_cursor_move(), and SPI_scroll_cursor_move().
1.7.1