86 self->pub.mydest =
dest;
94 self->attrinfo = NULL;
97 self->buf.data = NULL;
98 self->tmpcontext = NULL;
159 const char *portalName = portal->
name;
161 if (portalName == NULL || portalName[0] ==
'\0')
162 portalName =
"blank";
204 int natts = typeinfo->
natts;
226 int natts = typeinfo->
natts;
247 for (i = 0; i < natts; ++
i)
251 int32 atttypmod = att->atttypmod;
265 tlist_item =
lnext(targetlist, tlist_item);
272 tlist_item =
lnext(targetlist, tlist_item);
302 int natts = typeinfo->
natts;
305 for (i = 0; i < natts; ++
i)
309 int32 atttypmod = att->atttypmod;
338 myState->
nattrs = numAttrs;
345 for (i = 0; i < numAttrs; i++)
359 else if (format == 1)
368 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
369 errmsg(
"unsupported format code: %d", format)));
384 int natts = typeinfo->
natts;
407 for (i = 0; i < natts; ++
i)
429 if (thisState->
format == 0)
469 int natts = typeinfo->
natts;
494 for (i = 0; i < natts; ++
i)
512 for (i = 0; i < natts; ++
i)
579 printf(
"\t%2d: %s%s%s%s\t(typeid = %u, len = %d, typmod = %d, byval = %c)\n",
582 value != NULL ?
" = \"" :
"",
583 value != NULL ? value :
"",
584 value != NULL ?
"\"" :
"",
585 (
unsigned int) (attributeP->atttypid),
587 attributeP->atttypmod,
588 attributeP->attbyval ?
't' :
'f');
598 int natts = typeinfo->
natts;
604 for (i = 0; i < natts; ++
i)
617 int natts = typeinfo->
natts;
625 for (i = 0; i < natts; ++
i)
631 &typoutput, &typisvarlena);
658 int natts = typeinfo->
natts;
683 for (i = 0; i < natts; ++
i)
701 for (i = 0; i < natts; ++
i)
bool(* receiveSlot)(TupleTableSlot *slot, DestReceiver *self)
void SetRemoteDestReceiverParams(DestReceiver *self, Portal portal)
Oid getBaseTypeAndTypmod(Oid typid, int32 *typmod)
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
static ListCell * lnext(const List *l, const ListCell *c)
static bool printtup_internal_20(TupleTableSlot *slot, DestReceiver *self)
#define TupleDescAttr(tupdesc, i)
#define VALGRIND_CHECK_MEM_IS_DEFINED(addr, size)
static void printtup_prepare_info(DR_printtup *myState, TupleDesc typeinfo, int numAttrs)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
int errcode(int sqlerrcode)
void MemoryContextReset(MemoryContext context)
#define PG_PROTOCOL_MAJOR(v)
char * OutputFunctionCall(FmgrInfo *flinfo, Datum val)
void pfree(void *pointer)
static void SendRowDescriptionCols_3(StringInfo buf, TupleDesc typeinfo, List *targetlist, int16 *formats)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
PrinttupAttrInfo * myinfo
static void slot_getallattrs(TupleTableSlot *slot)
#define ALLOCSET_DEFAULT_SIZES
DestReceiver * printtup_create_DR(CommandDest dest)
void enlargeStringInfo(StringInfo str, int needed)
static ListCell * list_head(const List *l)
FormData_pg_attribute * Form_pg_attribute
bytea * SendFunctionCall(FmgrInfo *flinfo, Datum val)
MemoryContext CurrentMemoryContext
#define ereport(elevel, rest)
void initStringInfo(StringInfo str)
TupleDesc tts_tupleDescriptor
void getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena)
static void printatt(unsigned attributeId, Form_pg_attribute attributeP, char *value)
void * palloc0(Size size)
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
static void printtup_destroy(DestReceiver *self)
#define Assert(condition)
static void printtup_startup(DestReceiver *self, int operation, TupleDesc typeinfo)
static bool printtup_20(TupleTableSlot *slot, DestReceiver *self)
static bool printtup(TupleTableSlot *slot, DestReceiver *self)
bool debugtup(TupleTableSlot *slot, DestReceiver *self)
#define DatumGetPointer(X)
#define MAX_CONVERSION_GROWTH
char * OidOutputFunctionCall(Oid functionId, Datum val)
int errmsg(const char *fmt,...)
static void SendRowDescriptionCols_2(StringInfo buf, TupleDesc typeinfo, List *targetlist, int16 *formats)
static void printtup_shutdown(DestReceiver *self)
List * FetchPortalTargetList(Portal portal)
void debugStartup(DestReceiver *self, int operation, TupleDesc typeinfo)
void SendRowDescriptionMessage(StringInfo buf, TupleDesc typeinfo, List *targetlist, int16 *formats)
ProtocolVersion FrontendProtocol