#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"
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) |
| DestReceiver * | CreateDestReceiver (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 |
| DestReceiver * | None_Receiver = &donothingDR |
| 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;
}
| static void donothingCleanup | ( | DestReceiver * | self | ) | [static] |
| static void donothingReceive | ( | TupleTableSlot * | slot, | |
| DestReceiver * | self | |||
| ) | [static] |
| static void donothingStartup | ( | DestReceiver * | self, | |
| int | operation, | |||
| TupleDesc | typeinfo | |||
| ) | [static] |
| 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;
}
}
DestReceiver debugtupDR [static] |
DestReceiver donothingDR [static] |
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().
DestReceiver spi_printtupDR [static] |
1.7.1