86 self->pub.mydest =
dest;
94 self->attrinfo = NULL;
97 self->tmpcontext = NULL;
155 const char *portalName = portal->
name;
157 if (portalName == NULL || portalName[0] ==
'\0')
158 portalName =
"blank";
200 int natts = typeinfo->
natts;
222 int natts = typeinfo->
natts;
243 for (i = 0; i < natts; ++
i)
247 int32 atttypmod = att->atttypmod;
261 tlist_item =
lnext(tlist_item);
268 tlist_item =
lnext(tlist_item);
298 int natts = typeinfo->
natts;
301 for (i = 0; i < natts; ++
i)
305 int32 atttypmod = att->atttypmod;
334 myState->
nattrs = numAttrs;
341 for (i = 0; i < numAttrs; i++)
355 else if (format == 1)
364 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
365 errmsg(
"unsupported format code: %d", format)));
380 int natts = typeinfo->
natts;
403 for (i = 0; i < natts; ++
i)
425 if (thisState->
format == 0)
465 int natts = typeinfo->
natts;
490 for (i = 0; i < natts; ++
i)
508 for (i = 0; i < natts; ++
i)
571 printf(
"\t%2d: %s%s%s%s\t(typeid = %u, len = %d, typmod = %d, byval = %c)\n",
574 value != NULL ?
" = \"" :
"",
575 value != NULL ? value :
"",
576 value != NULL ?
"\"" :
"",
577 (
unsigned int) (attributeP->atttypid),
579 attributeP->atttypmod,
580 attributeP->attbyval ?
't' :
'f');
590 int natts = typeinfo->
natts;
596 for (i = 0; i < natts; ++
i)
609 int natts = typeinfo->
natts;
617 for (i = 0; i < natts; ++
i)
623 &typoutput, &typisvarlena);
650 int natts = typeinfo->
natts;
675 for (i = 0; i < natts; ++
i)
693 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)
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
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
#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 slot_getallattrs(TupleTableSlot *slot)
#define AllocSetContextCreate(parent, name, allocparams)
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 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)
Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
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