PostgreSQL Source Code  git master
tstoreReceiver.h File Reference
#include "tcop/dest.h"
#include "utils/tuplestore.h"
Include dependency graph for tstoreReceiver.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

DestReceiverCreateTuplestoreDestReceiver (void)
 
void SetTuplestoreDestReceiverParams (DestReceiver *self, Tuplestorestate *tStore, MemoryContext tContext, bool detoast, TupleDesc target_tupdesc, const char *map_failure_msg)
 

Function Documentation

◆ CreateTuplestoreDestReceiver()

DestReceiver* CreateTuplestoreDestReceiver ( void  )

Definition at line 238 of file tstoreReceiver.c.

References DestTuplestore, palloc0(), tstoreDestroyReceiver(), tstoreReceiveSlot_notoast(), tstoreShutdownReceiver(), and tstoreStartupReceiver().

Referenced by CreateDestReceiver().

239 {
240  TStoreState *self = (TStoreState *) palloc0(sizeof(TStoreState));
241 
242  self->pub.receiveSlot = tstoreReceiveSlot_notoast; /* might change */
243  self->pub.rStartup = tstoreStartupReceiver;
244  self->pub.rShutdown = tstoreShutdownReceiver;
245  self->pub.rDestroy = tstoreDestroyReceiver;
246  self->pub.mydest = DestTuplestore;
247 
248  /* private fields will be set by SetTuplestoreDestReceiverParams */
249 
250  return (DestReceiver *) self;
251 }
static void tstoreShutdownReceiver(DestReceiver *self)
static bool tstoreReceiveSlot_notoast(TupleTableSlot *slot, DestReceiver *self)
static void tstoreStartupReceiver(DestReceiver *self, int operation, TupleDesc typeinfo)
void * palloc0(Size size)
Definition: mcxt.c:981
static void tstoreDestroyReceiver(DestReceiver *self)

◆ SetTuplestoreDestReceiverParams()

void SetTuplestoreDestReceiverParams ( DestReceiver self,
Tuplestorestate tStore,
MemoryContext  tContext,
bool  detoast,
TupleDesc  target_tupdesc,
const char *  map_failure_msg 
)

Definition at line 266 of file tstoreReceiver.c.

References Assert, TStoreState::cxt, DestTuplestore, TStoreState::detoast, TStoreState::map_failure_msg, _DestReceiver::mydest, TStoreState::pub, TStoreState::target_tupdesc, and TStoreState::tstore.

Referenced by exec_stmt_return_query(), FillPortalStore(), and PersistHoldablePortal().

272 {
273  TStoreState *myState = (TStoreState *) self;
274 
275  Assert(!(detoast && target_tupdesc));
276 
277  Assert(myState->pub.mydest == DestTuplestore);
278  myState->tstore = tStore;
279  myState->cxt = tContext;
280  myState->detoast = detoast;
281  myState->target_tupdesc = target_tupdesc;
282  myState->map_failure_msg = map_failure_msg;
283 }
MemoryContext cxt
CommandDest mydest
Definition: dest.h:129
DestReceiver pub
Tuplestorestate * tstore
TupleDesc target_tupdesc
#define Assert(condition)
Definition: c.h:745
const char * map_failure_msg