PostgreSQL Source Code  git master
printtup.c File Reference
#include "postgres.h"
#include "access/printtup.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "tcop/pquery.h"
#include "utils/lsyscache.h"
#include "utils/memdebug.h"
#include "utils/memutils.h"
Include dependency graph for printtup.c:

Go to the source code of this file.

Data Structures

struct  PrinttupAttrInfo
 
struct  DR_printtup
 

Functions

static void printtup_startup (DestReceiver *self, int operation, TupleDesc typeinfo)
 
static bool printtup (TupleTableSlot *slot, DestReceiver *self)
 
static void printtup_shutdown (DestReceiver *self)
 
static void printtup_destroy (DestReceiver *self)
 
DestReceiverprinttup_create_DR (CommandDest dest)
 
void SetRemoteDestReceiverParams (DestReceiver *self, Portal portal)
 
void SendRowDescriptionMessage (StringInfo buf, TupleDesc typeinfo, List *targetlist, int16 *formats)
 
static void printtup_prepare_info (DR_printtup *myState, TupleDesc typeinfo, int numAttrs)
 
static void printatt (unsigned attributeId, Form_pg_attribute attributeP, char *value)
 
void debugStartup (DestReceiver *self, int operation, TupleDesc typeinfo)
 
bool debugtup (TupleTableSlot *slot, DestReceiver *self)
 

Function Documentation

◆ debugStartup()

void debugStartup ( DestReceiver self,
int  operation,
TupleDesc  typeinfo 
)

Definition at line 441 of file printtup.c.

References i, TupleDescData::natts, printatt(), printf, and TupleDescAttr.

442 {
443  int natts = typeinfo->natts;
444  int i;
445 
446  /*
447  * show the return type of the tuples
448  */
449  for (i = 0; i < natts; ++i)
450  printatt((unsigned) i + 1, TupleDescAttr(typeinfo, i), NULL);
451  printf("\t----\n");
452 }
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
#define printf(...)
Definition: port.h:222
static void printatt(unsigned attributeId, Form_pg_attribute attributeP, char *value)
Definition: printtup.c:420
int i

◆ debugtup()

bool debugtup ( TupleTableSlot slot,
DestReceiver self 
)

Definition at line 459 of file printtup.c.

References getTypeOutputInfo(), i, TupleDescData::natts, OidOutputFunctionCall(), printatt(), printf, slot_getattr(), TupleTableSlot::tts_tupleDescriptor, TupleDescAttr, and value.

Referenced by print_slot().

460 {
461  TupleDesc typeinfo = slot->tts_tupleDescriptor;
462  int natts = typeinfo->natts;
463  int i;
464  Datum attr;
465  char *value;
466  bool isnull;
467  Oid typoutput;
468  bool typisvarlena;
469 
470  for (i = 0; i < natts; ++i)
471  {
472  attr = slot_getattr(slot, i + 1, &isnull);
473  if (isnull)
474  continue;
475  getTypeOutputInfo(TupleDescAttr(typeinfo, i)->atttypid,
476  &typoutput, &typisvarlena);
477 
478  value = OidOutputFunctionCall(typoutput, attr);
479 
480  printatt((unsigned) i + 1, TupleDescAttr(typeinfo, i), value);
481  }
482  printf("\t----\n");
483 
484  return true;
485 }
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
Definition: lsyscache.c:2854
static struct @142 value
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
#define printf(...)
Definition: port.h:222
unsigned int Oid
Definition: postgres_ext.h:31
TupleDesc tts_tupleDescriptor
Definition: tuptable.h:124
static void printatt(unsigned attributeId, Form_pg_attribute attributeP, char *value)
Definition: printtup.c:420
uintptr_t Datum
Definition: postgres.h:411
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:381
char * OidOutputFunctionCall(Oid functionId, Datum val)
Definition: fmgr.c:1653
int i

◆ printatt()

static void printatt ( unsigned  attributeId,
Form_pg_attribute  attributeP,
char *  value 
)
static

Definition at line 420 of file printtup.c.

References NameStr, and printf.

Referenced by debugStartup(), and debugtup().

423 {
424  printf("\t%2d: %s%s%s%s\t(typeid = %u, len = %d, typmod = %d, byval = %c)\n",
425  attributeId,
426  NameStr(attributeP->attname),
427  value != NULL ? " = \"" : "",
428  value != NULL ? value : "",
429  value != NULL ? "\"" : "",
430  (unsigned int) (attributeP->atttypid),
431  attributeP->attlen,
432  attributeP->atttypmod,
433  attributeP->attbyval ? 't' : 'f');
434 }
static struct @142 value
#define printf(...)
Definition: port.h:222
#define NameStr(name)
Definition: c.h:681

◆ printtup()

static bool printtup ( TupleTableSlot slot,
DestReceiver self 
)
static

Definition at line 301 of file printtup.c.

References DR_printtup::attrinfo, DR_printtup::buf, buf, DatumGetPointer, PrinttupAttrInfo::finfo, PrinttupAttrInfo::format, i, MemoryContextReset(), MemoryContextSwitchTo(), DR_printtup::myinfo, DR_printtup::nattrs, TupleDescData::natts, OutputFunctionCall(), pq_beginmessage_reuse(), pq_endmessage_reuse(), pq_sendbytes(), pq_sendcountedtext(), pq_sendint16(), pq_sendint32(), printtup_prepare_info(), SendFunctionCall(), slot_getallattrs(), DR_printtup::tmpcontext, TupleTableSlot::tts_isnull, TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, PrinttupAttrInfo::typisvarlena, VALGRIND_CHECK_MEM_IS_DEFINED, VARDATA, VARHDRSZ, VARSIZE, and VARSIZE_ANY.

Referenced by printtup_create_DR().

302 {
303  TupleDesc typeinfo = slot->tts_tupleDescriptor;
304  DR_printtup *myState = (DR_printtup *) self;
305  MemoryContext oldcontext;
306  StringInfo buf = &myState->buf;
307  int natts = typeinfo->natts;
308  int i;
309 
310  /* Set or update my derived attribute info, if needed */
311  if (myState->attrinfo != typeinfo || myState->nattrs != natts)
312  printtup_prepare_info(myState, typeinfo, natts);
313 
314  /* Make sure the tuple is fully deconstructed */
315  slot_getallattrs(slot);
316 
317  /* Switch into per-row context so we can recover memory below */
318  oldcontext = MemoryContextSwitchTo(myState->tmpcontext);
319 
320  /*
321  * Prepare a DataRow message (note buffer is in per-row context)
322  */
323  pq_beginmessage_reuse(buf, 'D');
324 
325  pq_sendint16(buf, natts);
326 
327  /*
328  * send the attributes of this tuple
329  */
330  for (i = 0; i < natts; ++i)
331  {
332  PrinttupAttrInfo *thisState = myState->myinfo + i;
333  Datum attr = slot->tts_values[i];
334 
335  if (slot->tts_isnull[i])
336  {
337  pq_sendint32(buf, -1);
338  continue;
339  }
340 
341  /*
342  * Here we catch undefined bytes in datums that are returned to the
343  * client without hitting disk; see comments at the related check in
344  * PageAddItem(). This test is most useful for uncompressed,
345  * non-external datums, but we're quite likely to see such here when
346  * testing new C functions.
347  */
348  if (thisState->typisvarlena)
350  VARSIZE_ANY(attr));
351 
352  if (thisState->format == 0)
353  {
354  /* Text output */
355  char *outputstr;
356 
357  outputstr = OutputFunctionCall(&thisState->finfo, attr);
358  pq_sendcountedtext(buf, outputstr, strlen(outputstr), false);
359  }
360  else
361  {
362  /* Binary output */
363  bytea *outputbytes;
364 
365  outputbytes = SendFunctionCall(&thisState->finfo, attr);
366  pq_sendint32(buf, VARSIZE(outputbytes) - VARHDRSZ);
367  pq_sendbytes(buf, VARDATA(outputbytes),
368  VARSIZE(outputbytes) - VARHDRSZ);
369  }
370  }
371 
372  pq_endmessage_reuse(buf);
373 
374  /* Return to caller's context, and flush row's temporary memory */
375  MemoryContextSwitchTo(oldcontext);
376  MemoryContextReset(myState->tmpcontext);
377 
378  return true;
379 }
static void pq_sendint16(StringInfo buf, uint16 i)
Definition: pqformat.h:137
#define VARDATA(PTR)
Definition: postgres.h:315
#define VARSIZE(PTR)
Definition: postgres.h:316
#define VARHDRSZ
Definition: c.h:627
#define VALGRIND_CHECK_MEM_IS_DEFINED(addr, size)
Definition: memdebug.h:23
static void printtup_prepare_info(DR_printtup *myState, TupleDesc typeinfo, int numAttrs)
Definition: printtup.c:250
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
Datum * tts_values
Definition: tuptable.h:126
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:143
char * OutputFunctionCall(FmgrInfo *flinfo, Datum val)
Definition: fmgr.c:1573
static void pq_sendint32(StringInfo buf, uint32 i)
Definition: pqformat.h:145
TupleDesc attrinfo
Definition: printtup.c:59
PrinttupAttrInfo * myinfo
Definition: printtup.c:61
static void slot_getallattrs(TupleTableSlot *slot)
Definition: tuptable.h:354
static char * buf
Definition: pg_test_fsync.c:68
bool * tts_isnull
Definition: tuptable.h:128
bytea * SendFunctionCall(FmgrInfo *flinfo, Datum val)
Definition: fmgr.c:1634
int nattrs
Definition: printtup.c:60
void pq_sendcountedtext(StringInfo buf, const char *str, int slen, bool countincludesself)
Definition: pqformat.c:142
MemoryContext tmpcontext
Definition: printtup.c:63
TupleDesc tts_tupleDescriptor
Definition: tuptable.h:124
uintptr_t Datum
Definition: postgres.h:411
#define VARSIZE_ANY(PTR)
Definition: postgres.h:348
bool typisvarlena
Definition: printtup.c:49
#define DatumGetPointer(X)
Definition: postgres.h:593
void pq_sendbytes(StringInfo buf, const char *data, int datalen)
Definition: pqformat.c:125
int i
StringInfoData buf
Definition: printtup.c:62
Definition: c.h:621
void pq_endmessage_reuse(StringInfo buf)
Definition: pqformat.c:316
FmgrInfo finfo
Definition: printtup.c:51
void pq_beginmessage_reuse(StringInfo buf, char msgtype)
Definition: pqformat.c:108

◆ printtup_create_DR()

DestReceiver* printtup_create_DR ( CommandDest  dest)

Definition at line 71 of file printtup.c.

References generate_unaccent_rules::dest, DestRemote, palloc0(), printtup(), printtup_destroy(), printtup_shutdown(), and printtup_startup().

Referenced by CreateDestReceiver().

72 {
73  DR_printtup *self = (DR_printtup *) palloc0(sizeof(DR_printtup));
74 
75  self->pub.receiveSlot = printtup; /* might get changed later */
76  self->pub.rStartup = printtup_startup;
77  self->pub.rShutdown = printtup_shutdown;
78  self->pub.rDestroy = printtup_destroy;
79  self->pub.mydest = dest;
80 
81  /*
82  * Send T message automatically if DestRemote, but not if
83  * DestRemoteExecute
84  */
85  self->sendDescrip = (dest == DestRemote);
86 
87  self->attrinfo = NULL;
88  self->nattrs = 0;
89  self->myinfo = NULL;
90  self->buf.data = NULL;
91  self->tmpcontext = NULL;
92 
93  return (DestReceiver *) self;
94 }
void * palloc0(Size size)
Definition: mcxt.c:1093
static void printtup_destroy(DestReceiver *self)
Definition: printtup.c:410
static void printtup_startup(DestReceiver *self, int operation, TupleDesc typeinfo)
Definition: printtup.c:111
static bool printtup(TupleTableSlot *slot, DestReceiver *self)
Definition: printtup.c:301
static void printtup_shutdown(DestReceiver *self)
Definition: printtup.c:386

◆ printtup_destroy()

static void printtup_destroy ( DestReceiver self)
static

Definition at line 410 of file printtup.c.

References pfree().

Referenced by printtup_create_DR().

411 {
412  pfree(self);
413 }
void pfree(void *pointer)
Definition: mcxt.c:1169

◆ printtup_prepare_info()

static void printtup_prepare_info ( DR_printtup myState,
TupleDesc  typeinfo,
int  numAttrs 
)
static

Definition at line 250 of file printtup.c.

References DR_printtup::attrinfo, ereport, errcode(), errmsg(), ERROR, PrinttupAttrInfo::finfo, fmgr_info(), PrinttupAttrInfo::format, format, PortalData::formats, getTypeBinaryOutputInfo(), getTypeOutputInfo(), i, DR_printtup::myinfo, DR_printtup::nattrs, palloc0(), pfree(), DR_printtup::portal, TupleDescAttr, PrinttupAttrInfo::typisvarlena, PrinttupAttrInfo::typoutput, and PrinttupAttrInfo::typsend.

Referenced by printtup().

251 {
252  int16 *formats = myState->portal->formats;
253  int i;
254 
255  /* get rid of any old data */
256  if (myState->myinfo)
257  pfree(myState->myinfo);
258  myState->myinfo = NULL;
259 
260  myState->attrinfo = typeinfo;
261  myState->nattrs = numAttrs;
262  if (numAttrs <= 0)
263  return;
264 
265  myState->myinfo = (PrinttupAttrInfo *)
266  palloc0(numAttrs * sizeof(PrinttupAttrInfo));
267 
268  for (i = 0; i < numAttrs; i++)
269  {
270  PrinttupAttrInfo *thisState = myState->myinfo + i;
271  int16 format = (formats ? formats[i] : 0);
272  Form_pg_attribute attr = TupleDescAttr(typeinfo, i);
273 
274  thisState->format = format;
275  if (format == 0)
276  {
277  getTypeOutputInfo(attr->atttypid,
278  &thisState->typoutput,
279  &thisState->typisvarlena);
280  fmgr_info(thisState->typoutput, &thisState->finfo);
281  }
282  else if (format == 1)
283  {
284  getTypeBinaryOutputInfo(attr->atttypid,
285  &thisState->typsend,
286  &thisState->typisvarlena);
287  fmgr_info(thisState->typsend, &thisState->finfo);
288  }
289  else
290  ereport(ERROR,
291  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
292  errmsg("unsupported format code: %d", format)));
293  }
294 }
signed short int16
Definition: c.h:428
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
Definition: lsyscache.c:2854
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
int errcode(int sqlerrcode)
Definition: elog.c:698
TupleDesc attrinfo
Definition: printtup.c:59
void pfree(void *pointer)
Definition: mcxt.c:1169
#define ERROR
Definition: elog.h:46
Portal portal
Definition: printtup.c:57
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Definition: fmgr.c:126
PrinttupAttrInfo * myinfo
Definition: printtup.c:61
FormData_pg_attribute * Form_pg_attribute
Definition: pg_attribute.h:203
int nattrs
Definition: printtup.c:60
void getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena)
Definition: lsyscache.c:2920
void * palloc0(Size size)
Definition: mcxt.c:1093
int16 * formats
Definition: portal.h:161
#define ereport(elevel,...)
Definition: elog.h:157
bool typisvarlena
Definition: printtup.c:49
int errmsg(const char *fmt,...)
Definition: elog.c:909
int i
static char format
FmgrInfo finfo
Definition: printtup.c:51

◆ printtup_shutdown()

static void printtup_shutdown ( DestReceiver self)
static

Definition at line 386 of file printtup.c.

References DR_printtup::attrinfo, DR_printtup::buf, StringInfoData::data, MemoryContextDelete(), DR_printtup::myinfo, pfree(), and DR_printtup::tmpcontext.

Referenced by printtup_create_DR().

387 {
388  DR_printtup *myState = (DR_printtup *) self;
389 
390  if (myState->myinfo)
391  pfree(myState->myinfo);
392  myState->myinfo = NULL;
393 
394  myState->attrinfo = NULL;
395 
396  if (myState->buf.data)
397  pfree(myState->buf.data);
398  myState->buf.data = NULL;
399 
400  if (myState->tmpcontext)
402  myState->tmpcontext = NULL;
403 }
void MemoryContextDelete(MemoryContext context)
Definition: mcxt.c:218
TupleDesc attrinfo
Definition: printtup.c:59
void pfree(void *pointer)
Definition: mcxt.c:1169
PrinttupAttrInfo * myinfo
Definition: printtup.c:61
MemoryContext tmpcontext
Definition: printtup.c:63
StringInfoData buf
Definition: printtup.c:62

◆ printtup_startup()

static void printtup_startup ( DestReceiver self,
int  operation,
TupleDesc  typeinfo 
)
static

Definition at line 111 of file printtup.c.

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, DR_printtup::buf, CurrentMemoryContext, FetchPortalTargetList(), PortalData::formats, initStringInfo(), DR_printtup::portal, DR_printtup::sendDescrip, SendRowDescriptionMessage(), and DR_printtup::tmpcontext.

Referenced by printtup_create_DR().

112 {
113  DR_printtup *myState = (DR_printtup *) self;
114  Portal portal = myState->portal;
115 
116  /*
117  * Create I/O buffer to be used for all messages. This cannot be inside
118  * tmpcontext, since we want to re-use it across rows.
119  */
120  initStringInfo(&myState->buf);
121 
122  /*
123  * Create a temporary memory context that we can reset once per row to
124  * recover palloc'd memory. This avoids any problems with leaks inside
125  * datatype output routines, and should be faster than retail pfree's
126  * anyway.
127  */
129  "printtup",
131 
132  /*
133  * If we are supposed to emit row descriptions, then send the tuple
134  * descriptor of the tuples.
135  */
136  if (myState->sendDescrip)
137  SendRowDescriptionMessage(&myState->buf,
138  typeinfo,
139  FetchPortalTargetList(portal),
140  portal->formats);
141 
142  /* ----------------
143  * We could set up the derived attr info at this time, but we postpone it
144  * until the first call of printtup, for 2 reasons:
145  * 1. We don't waste time (compared to the old way) if there are no
146  * tuples at all to output.
147  * 2. Checking in printtup allows us to handle the case that the tuples
148  * change type midway through (although this probably can't happen in
149  * the current executor).
150  * ----------------
151  */
152 }
#define AllocSetContextCreate
Definition: memutils.h:173
Portal portal
Definition: printtup.c:57
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:195
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
void initStringInfo(StringInfo str)
Definition: stringinfo.c:59
MemoryContext tmpcontext
Definition: printtup.c:63
bool sendDescrip
Definition: printtup.c:58
int16 * formats
Definition: portal.h:161
StringInfoData buf
Definition: printtup.c:62
List * FetchPortalTargetList(Portal portal)
Definition: pquery.c:323
void SendRowDescriptionMessage(StringInfo buf, TupleDesc typeinfo, List *targetlist, int16 *formats)
Definition: printtup.c:166

◆ SendRowDescriptionMessage()

void SendRowDescriptionMessage ( StringInfo  buf,
TupleDesc  typeinfo,
List targetlist,
int16 formats 
)

Definition at line 166 of file printtup.c.

References enlargeStringInfo(), format, getBaseTypeAndTypmod(), i, lfirst, list_head(), lnext(), MAX_CONVERSION_GROWTH, NAMEDATALEN, NameStr, TupleDescData::natts, pq_beginmessage_reuse(), pq_endmessage_reuse(), pq_sendint16(), pq_writeint16(), pq_writeint32(), pq_writestring(), TargetEntry::resorigcol, TargetEntry::resorigtbl, and TupleDescAttr.

Referenced by exec_describe_portal_message(), exec_describe_statement_message(), and printtup_startup().

168 {
169  int natts = typeinfo->natts;
170  int i;
171  ListCell *tlist_item = list_head(targetlist);
172 
173  /* tuple descriptor message type */
174  pq_beginmessage_reuse(buf, 'T');
175  /* # of attrs in tuples */
176  pq_sendint16(buf, natts);
177 
178  /*
179  * Preallocate memory for the entire message to be sent. That allows to
180  * use the significantly faster inline pqformat.h functions and to avoid
181  * reallocations.
182  *
183  * Have to overestimate the size of the column-names, to account for
184  * character set overhead.
185  */
187  + sizeof(Oid) /* resorigtbl */
188  + sizeof(AttrNumber) /* resorigcol */
189  + sizeof(Oid) /* atttypid */
190  + sizeof(int16) /* attlen */
191  + sizeof(int32) /* attypmod */
192  + sizeof(int16) /* format */
193  ) * natts);
194 
195  for (i = 0; i < natts; ++i)
196  {
197  Form_pg_attribute att = TupleDescAttr(typeinfo, i);
198  Oid atttypid = att->atttypid;
199  int32 atttypmod = att->atttypmod;
200  Oid resorigtbl;
201  AttrNumber resorigcol;
202  int16 format;
203 
204  /*
205  * If column is a domain, send the base type and typmod instead.
206  * Lookup before sending any ints, for efficiency.
207  */
208  atttypid = getBaseTypeAndTypmod(atttypid, &atttypmod);
209 
210  /* Do we have a non-resjunk tlist item? */
211  while (tlist_item &&
212  ((TargetEntry *) lfirst(tlist_item))->resjunk)
213  tlist_item = lnext(targetlist, tlist_item);
214  if (tlist_item)
215  {
216  TargetEntry *tle = (TargetEntry *) lfirst(tlist_item);
217 
218  resorigtbl = tle->resorigtbl;
219  resorigcol = tle->resorigcol;
220  tlist_item = lnext(targetlist, tlist_item);
221  }
222  else
223  {
224  /* No info available, so send zeroes */
225  resorigtbl = 0;
226  resorigcol = 0;
227  }
228 
229  if (formats)
230  format = formats[i];
231  else
232  format = 0;
233 
234  pq_writestring(buf, NameStr(att->attname));
235  pq_writeint32(buf, resorigtbl);
236  pq_writeint16(buf, resorigcol);
237  pq_writeint32(buf, atttypid);
238  pq_writeint16(buf, att->attlen);
239  pq_writeint32(buf, atttypmod);
240  pq_writeint16(buf, format);
241  }
242 
243  pq_endmessage_reuse(buf);
244 }
signed short int16
Definition: c.h:428
static void pq_sendint16(StringInfo buf, uint16 i)
Definition: pqformat.h:137
Oid getBaseTypeAndTypmod(Oid typid, int32 *typmod)
Definition: lsyscache.c:2485
static void pq_writestring(StringInfoData *pg_restrict buf, const char *pg_restrict str)
Definition: pqformat.h:109
static ListCell * lnext(const List *l, const ListCell *c)
Definition: pg_list.h:322
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
Oid resorigtbl
Definition: primnodes.h:1449
unsigned int Oid
Definition: postgres_ext.h:31
signed int int32
Definition: c.h:429
#define NAMEDATALEN
static void pq_writeint16(StringInfoData *pg_restrict buf, uint16 i)
Definition: pqformat.h:61
static void pq_writeint32(StringInfoData *pg_restrict buf, uint32 i)
Definition: pqformat.h:75
void enlargeStringInfo(StringInfo str, int needed)
Definition: stringinfo.c:283
static ListCell * list_head(const List *l)
Definition: pg_list.h:125
FormData_pg_attribute * Form_pg_attribute
Definition: pg_attribute.h:203
#define lfirst(lc)
Definition: pg_list.h:169
#define MAX_CONVERSION_GROWTH
Definition: pg_wchar.h:316
AttrNumber resorigcol
Definition: primnodes.h:1450
int i
#define NameStr(name)
Definition: c.h:681
static char format
void pq_endmessage_reuse(StringInfo buf)
Definition: pqformat.c:316
int16 AttrNumber
Definition: attnum.h:21
void pq_beginmessage_reuse(StringInfo buf, char msgtype)
Definition: pqformat.c:108

◆ SetRemoteDestReceiverParams()

void SetRemoteDestReceiverParams ( DestReceiver self,
Portal  portal 
)

Definition at line 100 of file printtup.c.

References Assert, DestRemote, DestRemoteExecute, _DestReceiver::mydest, DR_printtup::portal, and DR_printtup::pub.

Referenced by exec_execute_message(), and exec_simple_query().

101 {
102  DR_printtup *myState = (DR_printtup *) self;
103 
104  Assert(myState->pub.mydest == DestRemote ||
105  myState->pub.mydest == DestRemoteExecute);
106 
107  myState->portal = portal;
108 }
DestReceiver pub
Definition: printtup.c:56
CommandDest mydest
Definition: dest.h:129
Portal portal
Definition: printtup.c:57
#define Assert(condition)
Definition: c.h:804