PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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)
 

Function Documentation

DestReceiver* CreateTuplestoreDestReceiver ( void  )

Definition at line 190 of file tstoreReceiver.c.

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

Referenced by CreateDestReceiver().

191 {
192  TStoreState *self = (TStoreState *) palloc0(sizeof(TStoreState));
193 
194  self->pub.receiveSlot = tstoreReceiveSlot_notoast; /* might change */
195  self->pub.rStartup = tstoreStartupReceiver;
196  self->pub.rShutdown = tstoreShutdownReceiver;
197  self->pub.rDestroy = tstoreDestroyReceiver;
198  self->pub.mydest = DestTuplestore;
199 
200  /* private fields will be set by SetTuplestoreDestReceiverParams */
201 
202  return (DestReceiver *) self;
203 }
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:878
static void tstoreDestroyReceiver(DestReceiver *self)
void SetTuplestoreDestReceiverParams ( DestReceiver self,
Tuplestorestate tStore,
MemoryContext  tContext,
bool  detoast 
)

Definition at line 209 of file tstoreReceiver.c.

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

Referenced by FillPortalStore(), and PersistHoldablePortal().

213 {
214  TStoreState *myState = (TStoreState *) self;
215 
216  Assert(myState->pub.mydest == DestTuplestore);
217  myState->tstore = tStore;
218  myState->cxt = tContext;
219  myState->detoast = detoast;
220 }
MemoryContext cxt
CommandDest mydest
Definition: dest.h:128
DestReceiver pub
Tuplestorestate * tstore
#define Assert(condition)
Definition: c.h:676