132 elog(
ERROR,
"getsomeattrs is not required to be called on a virtual tuple table slot");
146 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
147 errmsg(
"cannot retrieve a system column in this context")));
162 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
163 errmsg(
"don't have transaction information for this type of tuple")));
188 for (
int natt = 0; natt < desc->
natts; natt++)
224 for (
int natt = 0; natt < desc->
natts; natt++)
255 Size data_length = 0;
277 for (
int natt = 0; natt < srcdesc->
natts; natt++)
368 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
369 errmsg(
"cannot retrieve a system column in this context")));
390 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
391 errmsg(
"don't have a storage tuple in this context")));
494 hslot->
tuple = tuple;
563 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
564 errmsg(
"cannot retrieve a system column in this context")));
580 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
581 errmsg(
"don't have transaction information for this type of tuple")));
745 bslot->base.tuple = NULL;
771 if (!bslot->base.tuple)
773 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
774 errmsg(
"cannot retrieve a system column in this context")));
793 if (!bslot->base.tuple)
795 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
796 errmsg(
"don't have a storage tuple in this context")));
824 if (!bslot->base.tuple)
875 !bsrcslot->base.tuple)
899 memcpy(&bdstslot->base.tupdata, bdstslot->base.tuple,
sizeof(
HeapTupleData));
900 bdstslot->base.tuple = &bdstslot->base.tupdata;
911 if (!bslot->base.tuple)
914 return bslot->base.tuple;
924 if (!bslot->base.tuple)
937 if (!bslot->base.tuple)
945 Buffer buffer,
bool transfer_pin)
960 bslot->base.tuple = tuple;
975 if (bslot->
buffer != buffer)
1020 int attnum,
int natts,
bool slow,
1021 bool hasnulls,
uint32 *offp,
bool *slowp)
1029 bool slownext =
false;
1031 tp = (
char *) tup + tup->
t_hoff;
1055 else if (thisatt->
attlen == -1)
1082 thisatt->attcacheoff = *offp;
1096 if (slownext || thisatt->attlen <= 0)
1225 .get_heap_tuple = NULL,
1226 .get_minimal_tuple = NULL,
1244 .get_minimal_tuple = NULL,
1261 .get_heap_tuple = NULL,
1280 .get_minimal_tuple = NULL,
1324 slot->
type = T_TupleTableSlot;
1326 if (tupleDesc != NULL)
1332 if (tupleDesc != NULL)
1365 *tupleTable =
lappend(*tupleTable, slot);
1385 foreach(lc, tupleTable)
1553 elog(
ERROR,
"trying to store a heap tuple into wrong type of slot");
1594 elog(
ERROR,
"trying to store an on-disk heap tuple into wrong type of slot");
1620 elog(
ERROR,
"trying to store an on-disk heap tuple into wrong type of slot");
1647 elog(
ERROR,
"trying to store a minimal tuple into wrong type of slot");
1854 *shouldFree =
false;
1893 *shouldFree =
false;
2004 tupledesc, tts_ops);
2068 (lastAttNum - startAttNum) *
sizeof(
Datum));
2070 (lastAttNum - startAttNum) *
sizeof(
bool));
2077 for (missattnum = startAttNum;
2078 missattnum < lastAttNum;
2158 foreach(l, targetList)
2162 if (skipjunk && tle->resjunk)
2194 foreach(lc, exprList)
2228 foreach(lc, namesList)
2234 if (colno >= typeInfo->
natts)
2243 if (
cname[0] ==
'\0' || attr->attisdropped)
2262 if (tupdesc->
tdtypeid == RECORDOID &&
2277 int natts = tupdesc->
natts;
2298 for (
i = 0;
i < natts;
i++)
2303 if (!att->attisdropped)
2305 atttypeid = att->atttypid;
2308 atttypmods[
i] = att->atttypmod;
2327 int natts = tupdesc->
natts;
2334 nulls = (
bool *)
palloc(natts *
sizeof(
bool));
2340 for (
i = 0;
i < natts;
i++)
2474 memcpy(slot->
tts_isnull, isnull, natts *
sizeof(
bool));
2495 bool isnull[1] = {
false};
2502 eol = strchr(txt,
'\n');
static Datum values[MAXATTR]
void IncrBufferRefCount(Buffer buffer)
void ReleaseBuffer(Buffer buffer)
static bool BufferIsValid(Buffer bufnum)
#define pg_attribute_always_inline
#define MemSet(start, val, len)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
static void tts_heap_store_tuple(TupleTableSlot *slot, HeapTuple tuple, bool shouldFree)
static void tts_buffer_heap_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
static void tts_buffer_heap_store_tuple(TupleTableSlot *slot, HeapTuple tuple, Buffer buffer, bool transfer_pin)
static HeapTuple tts_minimal_copy_heap_tuple(TupleTableSlot *slot)
static MinimalTuple tts_virtual_copy_minimal_tuple(TupleTableSlot *slot, Size extra)
void ExecResetTupleTable(List *tupleTable, bool shouldFree)
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
static Datum tts_heap_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
static HeapTuple tts_buffer_heap_copy_heap_tuple(TupleTableSlot *slot)
HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values)
static void tts_buffer_heap_clear(TupleTableSlot *slot)
TupleTableSlot * ExecStorePinnedBufferHeapTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer)
static void tts_minimal_store_tuple(TupleTableSlot *slot, MinimalTuple mtup, bool shouldFree)
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull)
const TupleTableSlotOps TTSOpsVirtual
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
static Datum tts_buffer_heap_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
static void tts_minimal_init(TupleTableSlot *slot)
static void tts_heap_init(TupleTableSlot *slot)
TupleTableSlot * ExecStoreVirtualTuple(TupleTableSlot *slot)
static bool tts_buffer_is_current_xact_tuple(TupleTableSlot *slot)
Datum HeapTupleHeaderGetDatum(HeapTupleHeader tuple)
TupleTableSlot * ExecAllocTableSlot(List **tupleTable, TupleDesc desc, const TupleTableSlotOps *tts_ops)
static TupleDesc ExecTypeFromTLInternal(List *targetList, bool skipjunk)
static pg_attribute_always_inline int slot_deform_heap_tuple_internal(TupleTableSlot *slot, HeapTuple tuple, int attnum, int natts, bool slow, bool hasnulls, uint32 *offp, bool *slowp)
static HeapTuple tts_buffer_heap_get_heap_tuple(TupleTableSlot *slot)
TupleDesc ExecCleanTypeFromTL(List *targetList)
static HeapTuple tts_virtual_copy_heap_tuple(TupleTableSlot *slot)
void ExecInitResultSlot(PlanState *planstate, const TupleTableSlotOps *tts_ops)
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
void ExecForceStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
const TupleTableSlotOps TTSOpsBufferHeapTuple
static void tts_buffer_heap_release(TupleTableSlot *slot)
void end_tup_output(TupOutputState *tstate)
static void tts_minimal_clear(TupleTableSlot *slot)
static MinimalTuple tts_buffer_heap_copy_minimal_tuple(TupleTableSlot *slot, Size extra)
MinimalTuple ExecFetchSlotMinimalTuple(TupleTableSlot *slot, bool *shouldFree)
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
void ExecInitResultTypeTL(PlanState *planstate)
TupleTableSlot * ExecStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
static void tts_virtual_clear(TupleTableSlot *slot)
static void tts_buffer_heap_materialize(TupleTableSlot *slot)
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
static void tts_virtual_release(TupleTableSlot *slot)
HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree)
void slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, int lastAttNum)
static void tts_minimal_materialize(TupleTableSlot *slot)
TupleTableSlot * ExecStoreBufferHeapTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer)
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
static MinimalTuple tts_minimal_get_minimal_tuple(TupleTableSlot *slot)
static void tts_minimal_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
static void tts_virtual_init(TupleTableSlot *slot)
void ExecStoreHeapTupleDatum(Datum data, TupleTableSlot *slot)
void ExecSetSlotDescriptor(TupleTableSlot *slot, TupleDesc tupdesc)
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
static void tts_minimal_release(TupleTableSlot *slot)
Datum ExecFetchSlotHeapTupleDatum(TupleTableSlot *slot)
const TupleTableSlotOps TTSOpsHeapTuple
static HeapTuple tts_heap_copy_heap_tuple(TupleTableSlot *slot)
void slot_getsomeattrs_int(TupleTableSlot *slot, int attnum)
static Datum tts_minimal_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
const TupleTableSlotOps TTSOpsMinimalTuple
static pg_attribute_always_inline void slot_deform_heap_tuple(TupleTableSlot *slot, HeapTuple tuple, uint32 *offp, int natts)
static void tts_virtual_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
static bool tts_virtual_is_current_xact_tuple(TupleTableSlot *slot)
static void tts_buffer_heap_getsomeattrs(TupleTableSlot *slot, int natts)
static void tts_virtual_getsomeattrs(TupleTableSlot *slot, int natts)
static MinimalTuple tts_heap_copy_minimal_tuple(TupleTableSlot *slot, Size extra)
TupleDesc ExecTypeFromExprList(List *exprList)
static void tts_heap_materialize(TupleTableSlot *slot)
TupleTableSlot * ExecStoreAllNullTuple(TupleTableSlot *slot)
static void tts_virtual_materialize(TupleTableSlot *slot)
TupleDesc ExecTypeFromTL(List *targetList)
AttInMetadata * TupleDescGetAttInMetadata(TupleDesc tupdesc)
static bool tts_minimal_is_current_xact_tuple(TupleTableSlot *slot)
static MinimalTuple tts_minimal_copy_minimal_tuple(TupleTableSlot *slot, Size extra)
static HeapTuple tts_heap_get_heap_tuple(TupleTableSlot *slot)
static void tts_minimal_getsomeattrs(TupleTableSlot *slot, int natts)
TupleTableSlot * MakeTupleTableSlot(TupleDesc tupleDesc, const TupleTableSlotOps *tts_ops)
static void tts_heap_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops)
static void tts_heap_clear(TupleTableSlot *slot)
TupleTableSlot * ExecStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
static void tts_heap_getsomeattrs(TupleTableSlot *slot, int natts)
static void tts_heap_release(TupleTableSlot *slot)
static void tts_buffer_heap_init(TupleTableSlot *slot)
static bool tts_heap_is_current_xact_tuple(TupleTableSlot *slot)
void ExecForceStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
static Datum tts_virtual_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
int ExecTargetListLength(List *targetlist)
int ExecCleanTargetListLength(List *targetlist)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void EOH_flatten_into(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
Size EOH_get_flat_size(ExpandedObjectHeader *eohptr)
Datum InputFunctionCall(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
#define DatumGetHeapTupleHeader(X)
Assert(PointerIsAligned(start, uint64))
Datum toast_flatten_tuple_to_datum(HeapTupleHeader tup, uint32 tup_len, TupleDesc tupleDesc)
HeapTuple heap_copytuple(HeapTuple tuple)
MinimalTuple heap_copy_minimal_tuple(MinimalTuple mtup, Size extra)
Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
MinimalTuple heap_form_minimal_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull, Size extra)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
void heap_free_minimal_tuple(MinimalTuple mtup)
MinimalTuple minimal_tuple_from_heap_tuple(HeapTuple htup, Size extra)
void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull)
Datum heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
HeapTuple heap_tuple_from_minimal_tuple(MinimalTuple mtup)
void heap_freetuple(HeapTuple htup)
HeapTupleHeaderData * HeapTupleHeader
#define MINIMAL_TUPLE_OFFSET
#define HeapTupleHeaderGetNatts(tup)
static bool HeapTupleHasNulls(const HeapTupleData *tuple)
static int32 HeapTupleHeaderGetTypMod(const HeapTupleHeaderData *tup)
static TransactionId HeapTupleHeaderGetRawXmin(const HeapTupleHeaderData *tup)
static uint32 HeapTupleHeaderGetDatumLength(const HeapTupleHeaderData *tup)
#define HeapTupleHeaderHasExternal(tup)
static Oid HeapTupleHeaderGetTypeId(const HeapTupleHeaderData *tup)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
List * lappend(List *list, void *datum)
void list_free(List *list)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
void * MemoryContextAlloc(MemoryContext context, Size size)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
void namestrcpy(Name name, const char *str)
Oid exprType(const Node *expr)
int32 exprTypmod(const Node *expr)
Oid exprCollation(const Node *expr)
#define IsA(nodeptr, _type_)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
FormData_pg_attribute * Form_pg_attribute
#define lfirst_node(type, lc)
static int list_length(const List *l)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
const TupleTableSlotOps * resultops
const TupleTableSlotOps * scanops
TupleDesc ps_ResultTupleDesc
TupleTableSlot * ps_ResultTupleSlot
TupleTableSlot * ss_ScanTupleSlot
struct AttrMissing * missing
HeapTuple(* get_heap_tuple)(TupleTableSlot *slot)
MinimalTuple(* copy_minimal_tuple)(TupleTableSlot *slot, Size extra)
void(* init)(TupleTableSlot *slot)
void(* getsomeattrs)(TupleTableSlot *slot, int natts)
HeapTuple(* copy_heap_tuple)(TupleTableSlot *slot)
MinimalTuple(* get_minimal_tuple)(TupleTableSlot *slot)
void(* materialize)(TupleTableSlot *slot)
void(* release)(TupleTableSlot *slot)
TupleDesc tts_tupleDescriptor
const TupleTableSlotOps *const tts_ops
void(* rStartup)(DestReceiver *self, int operation, TupleDesc typeinfo)
void(* rShutdown)(DestReceiver *self)
bool(* receiveSlot)(TupleTableSlot *slot, DestReceiver *self)
TupleDesc CreateTemplateTupleDesc(int natts)
void TupleDescInitEntryCollation(TupleDesc desc, AttrNumber attributeNumber, Oid collationid)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
#define ReleaseTupleDesc(tupdesc)
#define PinTupleDesc(tupdesc)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
static CompactAttribute * TupleDescCompactAttr(TupleDesc tupdesc, int i)
#define att_nominal_alignby(cur_offset, attalignby)
static bool att_isnull(int ATT, const bits8 *BITS)
#define att_addlength_pointer(cur_offset, attlen, attptr)
#define att_pointer_alignby(cur_offset, attalignby, attlen, attptr)
#define att_addlength_datum(cur_offset, attlen, attdatum)
#define TTS_FLAG_SHOULDFREE
#define TTS_IS_MINIMALTUPLE(slot)
static MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot *slot)
struct MinimalTupleTableSlot MinimalTupleTableSlot
static HeapTuple ExecCopySlotHeapTuple(TupleTableSlot *slot)
#define TTS_IS_BUFFERTUPLE(slot)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
static void slot_getallattrs(TupleTableSlot *slot)
struct HeapTupleTableSlot HeapTupleTableSlot
#define TTS_SHOULDFREE(slot)
struct BufferHeapTupleTableSlot BufferHeapTupleTableSlot
static void ExecMaterializeSlot(TupleTableSlot *slot)
struct VirtualTupleTableSlot VirtualTupleTableSlot
#define TTS_IS_HEAPTUPLE(slot)
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
void assign_record_type_typmod(TupleDesc tupDesc)
#define VARATT_IS_EXTERNAL_EXPANDED(PTR)
text * cstring_to_text_with_len(const char *s, int len)
bool TransactionIdIsCurrentTransactionId(TransactionId xid)