PostgreSQL Source Code  git master
tuptable.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tuptable.h
4  * tuple table support stuff
5  *
6  *
7  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/executor/tuptable.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TUPTABLE_H
15 #define TUPTABLE_H
16 
17 #include "access/htup.h"
18 #include "access/htup_details.h"
19 #include "access/sysattr.h"
20 #include "access/tupdesc.h"
21 #include "storage/buf.h"
22 
23 /*----------
24  * The executor stores tuples in a "tuple table" which is a List of
25  * independent TupleTableSlots.
26  *
27  * There's various different types of tuple table slots, each being able to
28  * store different types of tuples. Additional types of slots can be added
29  * without modifying core code. The type of a slot is determined by the
30  * TupleTableSlotOps* passed to the slot creation routine. The builtin types
31  * of slots are
32  *
33  * 1. physical tuple in a disk buffer page (TTSOpsBufferHeapTuple)
34  * 2. physical tuple constructed in palloc'ed memory (TTSOpsHeapTuple)
35  * 3. "minimal" physical tuple constructed in palloc'ed memory
36  * (TTSOpsMinimalTuple)
37  * 4. "virtual" tuple consisting of Datum/isnull arrays (TTSOpsVirtual)
38  *
39  *
40  * The first two cases are similar in that they both deal with "materialized"
41  * tuples, but resource management is different. For a tuple in a disk page
42  * we need to hold a pin on the buffer until the TupleTableSlot's reference
43  * to the tuple is dropped; while for a palloc'd tuple we usually want the
44  * tuple pfree'd when the TupleTableSlot's reference is dropped.
45  *
46  * A "minimal" tuple is handled similarly to a palloc'd regular tuple.
47  * At present, minimal tuples never are stored in buffers, so there is no
48  * parallel to case 1. Note that a minimal tuple has no "system columns".
49  * (Actually, it could have an OID, but we have no need to access the OID.)
50  *
51  * A "virtual" tuple is an optimization used to minimize physical data copying
52  * in a nest of plan nodes. Until materialized pass-by-reference Datums in
53  * the slot point to storage that is not directly associated with the
54  * TupleTableSlot; generally they will point to part of a tuple stored in a
55  * lower plan node's output TupleTableSlot, or to a function result
56  * constructed in a plan node's per-tuple econtext. It is the responsibility
57  * of the generating plan node to be sure these resources are not released for
58  * as long as the virtual tuple needs to be valid or is materialized. Note
59  * also that a virtual tuple does not have any "system columns".
60  *
61  * The Datum/isnull arrays of a TupleTableSlot serve double duty. For virtual
62  * slots they are the authoritative data. For the other builtin slots,
63  * the arrays contain data extracted from the tuple. (In this state, any
64  * pass-by-reference Datums point into the physical tuple.) The extracted
65  * information is built "lazily", ie, only as needed. This serves to avoid
66  * repeated extraction of data from the physical tuple.
67  *
68  * A TupleTableSlot can also be "empty", indicated by flag TTS_FLAG_EMPTY set
69  * in tts_flags, holding no valid data. This is the only valid state for a
70  * freshly-created slot that has not yet had a tuple descriptor assigned to
71  * it. In this state, TTS_FLAG_SHOULDFREE should not be set in tts_flags and
72  * tts_nvalid should be set to zero.
73  *
74  * The tupleDescriptor is simply referenced, not copied, by the TupleTableSlot
75  * code. The caller of ExecSetSlotDescriptor() is responsible for providing
76  * a descriptor that will live as long as the slot does. (Typically, both
77  * slots and descriptors are in per-query memory and are freed by memory
78  * context deallocation at query end; so it's not worth providing any extra
79  * mechanism to do more. However, the slot will increment the tupdesc
80  * reference count if a reference-counted tupdesc is supplied.)
81  *
82  * When TTS_FLAG_SHOULDFREE is set in tts_flags, the physical tuple is "owned"
83  * by the slot and should be freed when the slot's reference to the tuple is
84  * dropped.
85  *
86  * tts_values/tts_isnull are allocated either when the slot is created (when
87  * the descriptor is provided), or when a descriptor is assigned to the slot;
88  * they are of length equal to the descriptor's natts.
89  *
90  * The TTS_FLAG_SLOW flag is saved state for
91  * slot_deform_heap_tuple, and should not be touched by any other code.
92  *----------
93  */
94 
95 /* true = slot is empty */
96 #define TTS_FLAG_EMPTY (1 << 1)
97 #define TTS_EMPTY(slot) (((slot)->tts_flags & TTS_FLAG_EMPTY) != 0)
98 
99 /* should pfree tuple "owned" by the slot? */
100 #define TTS_FLAG_SHOULDFREE (1 << 2)
101 #define TTS_SHOULDFREE(slot) (((slot)->tts_flags & TTS_FLAG_SHOULDFREE) != 0)
102 
103 /* saved state for slot_deform_heap_tuple */
104 #define TTS_FLAG_SLOW (1 << 3)
105 #define TTS_SLOW(slot) (((slot)->tts_flags & TTS_FLAG_SLOW) != 0)
106 
107 /* fixed tuple descriptor */
108 #define TTS_FLAG_FIXED (1 << 4)
109 #define TTS_FIXED(slot) (((slot)->tts_flags & TTS_FLAG_FIXED) != 0)
110 
111 struct TupleTableSlotOps;
112 typedef struct TupleTableSlotOps TupleTableSlotOps;
113 
114 /* base tuple table slot type */
115 typedef struct TupleTableSlot
116 {
118 #define FIELDNO_TUPLETABLESLOT_FLAGS 1
119  uint16 tts_flags; /* Boolean states */
120 #define FIELDNO_TUPLETABLESLOT_NVALID 2
121  AttrNumber tts_nvalid; /* # of valid values in tts_values */
122  const TupleTableSlotOps *const tts_ops; /* implementation of slot */
123 #define FIELDNO_TUPLETABLESLOT_TUPLEDESCRIPTOR 4
124  TupleDesc tts_tupleDescriptor; /* slot's tuple descriptor */
125 #define FIELDNO_TUPLETABLESLOT_VALUES 5
126  Datum *tts_values; /* current per-attribute values */
127 #define FIELDNO_TUPLETABLESLOT_ISNULL 6
128  bool *tts_isnull; /* current per-attribute isnull flags */
129  MemoryContext tts_mcxt; /* slot itself is in this context */
130  ItemPointerData tts_tid; /* stored tuple's tid */
131  Oid tts_tableOid; /* table oid of tuple */
133 
134 /* routines for a TupleTableSlot implementation */
136 {
137  /* Minimum size of the slot */
139 
140  /* Initialization. */
141  void (*init) (TupleTableSlot *slot);
142 
143  /* Destruction. */
144  void (*release) (TupleTableSlot *slot);
145 
146  /*
147  * Clear the contents of the slot. Only the contents are expected to be
148  * cleared and not the tuple descriptor. Typically an implementation of
149  * this callback should free the memory allocated for the tuple contained
150  * in the slot.
151  */
152  void (*clear) (TupleTableSlot *slot);
153 
154  /*
155  * Fill up first natts entries of tts_values and tts_isnull arrays with
156  * values from the tuple contained in the slot. The function may be called
157  * with natts more than the number of attributes available in the tuple,
158  * in which case it should set tts_nvalid to the number of returned
159  * columns.
160  */
161  void (*getsomeattrs) (TupleTableSlot *slot, int natts);
162 
163  /*
164  * Returns value of the given system attribute as a datum and sets isnull
165  * to false, if it's not NULL. Throws an error if the slot type does not
166  * support system attributes.
167  */
168  Datum (*getsysattr) (TupleTableSlot *slot, int attnum, bool *isnull);
169 
170  /*
171  * Make the contents of the slot solely depend on the slot, and not on
172  * underlying resources (like another memory context, buffers, etc).
173  */
174  void (*materialize) (TupleTableSlot *slot);
175 
176  /*
177  * Copy the contents of the source slot into the destination slot's own
178  * context. Invoked using callback of the destination slot.
179  */
180  void (*copyslot) (TupleTableSlot *dstslot, TupleTableSlot *srcslot);
181 
182  /*
183  * Return a heap tuple "owned" by the slot. It is slot's responsibility to
184  * free the memory consumed by the heap tuple. If the slot can not "own" a
185  * heap tuple, it should not implement this callback and should set it as
186  * NULL.
187  */
189 
190  /*
191  * Return a minimal tuple "owned" by the slot. It is slot's responsibility
192  * to free the memory consumed by the minimal tuple. If the slot can not
193  * "own" a minimal tuple, it should not implement this callback and should
194  * set it as NULL.
195  */
197 
198  /*
199  * Return a copy of heap tuple representing the contents of the slot. The
200  * copy needs to be palloc'd in the current memory context. The slot
201  * itself is expected to remain unaffected. It is *not* expected to have
202  * meaningful "system columns" in the copy. The copy is not be "owned" by
203  * the slot i.e. the caller has to take responsibility to free memory
204  * consumed by the slot.
205  */
207 
208  /*
209  * Return a copy of minimal tuple representing the contents of the slot.
210  * The copy needs to be palloc'd in the current memory context. The slot
211  * itself is expected to remain unaffected. It is *not* expected to have
212  * meaningful "system columns" in the copy. The copy is not be "owned" by
213  * the slot i.e. the caller has to take responsibility to free memory
214  * consumed by the slot.
215  */
217 };
218 
219 /*
220  * Predefined TupleTableSlotOps for various types of TupleTableSlotOps. The
221  * same are used to identify the type of a given slot.
222  */
227 
228 #define TTS_IS_VIRTUAL(slot) ((slot)->tts_ops == &TTSOpsVirtual)
229 #define TTS_IS_HEAPTUPLE(slot) ((slot)->tts_ops == &TTSOpsHeapTuple)
230 #define TTS_IS_MINIMALTUPLE(slot) ((slot)->tts_ops == &TTSOpsMinimalTuple)
231 #define TTS_IS_BUFFERTUPLE(slot) ((slot)->tts_ops == &TTSOpsBufferHeapTuple)
232 
233 
234 /*
235  * Tuple table slot implementations.
236  */
237 
238 typedef struct VirtualTupleTableSlot
239 {
240  pg_node_attr(abstract)
241 
242  TupleTableSlot base;
243 
244  char *data; /* data for materialized slots */
246 
247 typedef struct HeapTupleTableSlot
248 {
249  pg_node_attr(abstract)
250 
251  TupleTableSlot base;
252 
253 #define FIELDNO_HEAPTUPLETABLESLOT_TUPLE 1
254  HeapTuple tuple; /* physical tuple */
255 #define FIELDNO_HEAPTUPLETABLESLOT_OFF 2
256  uint32 off; /* saved state for slot_deform_heap_tuple */
257  HeapTupleData tupdata; /* optional workspace for storing tuple */
259 
260 /* heap tuple residing in a buffer */
262 {
263  pg_node_attr(abstract)
264 
265  HeapTupleTableSlot base;
266 
267  /*
268  * If buffer is not InvalidBuffer, then the slot is holding a pin on the
269  * indicated buffer page; drop the pin when we release the slot's
270  * reference to that buffer. (TTS_FLAG_SHOULDFREE should not be set in
271  * such a case, since presumably base.tuple is pointing into the buffer.)
272  */
273  Buffer buffer; /* tuple's buffer, or InvalidBuffer */
275 
276 typedef struct MinimalTupleTableSlot
277 {
278  pg_node_attr(abstract)
279 
280  TupleTableSlot base;
281 
282  /*
283  * In a minimal slot tuple points at minhdr and the fields of that struct
284  * are set correctly for access to the minimal tuple; in particular,
285  * minhdr.t_data points MINIMAL_TUPLE_OFFSET bytes before mintuple. This
286  * allows column extraction to treat the case identically to regular
287  * physical tuples.
288  */
289 #define FIELDNO_MINIMALTUPLETABLESLOT_TUPLE 1
290  HeapTuple tuple; /* tuple wrapper */
291  MinimalTuple mintuple; /* minimal tuple, or NULL if none */
292  HeapTupleData minhdr; /* workspace for minimal-tuple-only case */
293 #define FIELDNO_MINIMALTUPLETABLESLOT_OFF 4
294  uint32 off; /* saved state for slot_deform_heap_tuple */
296 
297 /*
298  * TupIsNull -- is a TupleTableSlot empty?
299  */
300 #define TupIsNull(slot) \
301  ((slot) == NULL || TTS_EMPTY(slot))
302 
303 /*----------
304  * LazyTupleTableSlot -- a lazy version of TupleTableSlot.
305  *
306  * Sometimes caller might need to pass to the function a slot, which most
307  * likely will reain undemanded. Preallocating such slot would be a waste of
308  * resources in the majority of cases. Lazy slot is aimed to resolve this
309  * problem. It is basically a promise to allocate the slot once it's needed.
310  * Once callee needs the slot, it could get it using LAZY_TTS_EVAL(lazySlot)
311  * macro.
312  */
313 typedef struct
314 {
315  TupleTableSlot *slot; /* cached slot or NULL if not yet allocated */
316  TupleTableSlot *(*getSlot) (void *arg); /* callback for slot allocation */
317  void *getSlotArg; /* argument for the callback above */
319 
320 /*
321  * A constructor for the lazy slot.
322  */
323 #define MAKE_LAZY_TTS(lazySlot, callback, arg) \
324  do { \
325  (lazySlot)->slot = NULL; \
326  (lazySlot)->getSlot = callback; \
327  (lazySlot)->getSlotArg = arg; \
328  } while (false)
329 
330 /*
331  * Macro for lazy slot evaluation. NULL lazy slot evaluates to NULL slot.
332  * Cached version is used if present. Use the callback otherwise.
333  */
334 #define LAZY_TTS_EVAL(lazySlot) \
335  ((lazySlot) ? \
336  ((lazySlot)->slot ? \
337  (lazySlot)->slot : \
338  ((lazySlot)->slot = (lazySlot)->getSlot((lazySlot)->getSlotArg))) : \
339  NULL)
340 
341 /* in executor/execTuples.c */
343  const TupleTableSlotOps *tts_ops);
344 extern TupleTableSlot *ExecAllocTableSlot(List **tupleTable, TupleDesc desc,
345  const TupleTableSlotOps *tts_ops);
346 extern void ExecResetTupleTable(List *tupleTable, bool shouldFree);
348  const TupleTableSlotOps *tts_ops);
350 extern void ExecSetSlotDescriptor(TupleTableSlot *slot, TupleDesc tupdesc);
352  TupleTableSlot *slot,
353  bool shouldFree);
354 extern void ExecForceStoreHeapTuple(HeapTuple tuple,
355  TupleTableSlot *slot,
356  bool shouldFree);
358  TupleTableSlot *slot,
359  Buffer buffer);
361  TupleTableSlot *slot,
362  Buffer buffer);
364  TupleTableSlot *slot,
365  bool shouldFree);
367  bool shouldFree);
371 extern HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree);
373  bool *shouldFree);
375 extern void slot_getmissingattrs(TupleTableSlot *slot, int startAttNum,
376  int lastAttNum);
377 extern void slot_getsomeattrs_int(TupleTableSlot *slot, int attnum);
378 
379 
380 #ifndef FRONTEND
381 
382 /*
383  * This function forces the entries of the slot's Datum/isnull arrays to be
384  * valid at least up through the attnum'th entry.
385  */
386 static inline void
388 {
389  if (slot->tts_nvalid < attnum)
391 }
392 
393 /*
394  * slot_getallattrs
395  * This function forces all the entries of the slot's Datum/isnull
396  * arrays to be valid. The caller may then extract data directly
397  * from those arrays instead of using slot_getattr.
398  */
399 static inline void
401 {
403 }
404 
405 
406 /*
407  * slot_attisnull
408  *
409  * Detect whether an attribute of the slot is null, without actually fetching
410  * it.
411  */
412 static inline bool
414 {
415  Assert(attnum > 0);
416 
417  if (attnum > slot->tts_nvalid)
418  slot_getsomeattrs(slot, attnum);
419 
420  return slot->tts_isnull[attnum - 1];
421 }
422 
423 /*
424  * slot_getattr - fetch one attribute of the slot's contents.
425  */
426 static inline Datum
428  bool *isnull)
429 {
430  Assert(attnum > 0);
431 
432  if (attnum > slot->tts_nvalid)
433  slot_getsomeattrs(slot, attnum);
434 
435  *isnull = slot->tts_isnull[attnum - 1];
436 
437  return slot->tts_values[attnum - 1];
438 }
439 
440 /*
441  * slot_getsysattr - fetch a system attribute of the slot's current tuple.
442  *
443  * If the slot type does not contain system attributes, this will throw an
444  * error. Hence before calling this function, callers should make sure that
445  * the slot type is the one that supports system attributes.
446  */
447 static inline Datum
448 slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
449 {
450  Assert(attnum < 0); /* caller error */
451 
453  {
454  *isnull = false;
455  return ObjectIdGetDatum(slot->tts_tableOid);
456  }
458  {
459  *isnull = false;
460  return PointerGetDatum(&slot->tts_tid);
461  }
462 
463  /* Fetch the system attribute from the underlying tuple. */
464  return slot->tts_ops->getsysattr(slot, attnum, isnull);
465 }
466 
467 /*
468  * ExecClearTuple - clear the slot's contents
469  */
470 static inline TupleTableSlot *
472 {
473  slot->tts_ops->clear(slot);
474 
475  return slot;
476 }
477 
478 /* ExecMaterializeSlot - force a slot into the "materialized" state.
479  *
480  * This causes the slot's tuple to be a local copy not dependent on any
481  * external storage (i.e. pointing into a Buffer, or having allocations in
482  * another memory context).
483  *
484  * A typical use for this operation is to prepare a computed tuple for being
485  * stored on disk. The original data may or may not be virtual, but in any
486  * case we need a private copy for heap_insert to scribble on.
487  */
488 static inline void
490 {
491  slot->tts_ops->materialize(slot);
492 }
493 
494 /*
495  * ExecCopySlotHeapTuple - return HeapTuple allocated in caller's context
496  */
497 static inline HeapTuple
499 {
500  Assert(!TTS_EMPTY(slot));
501 
502  return slot->tts_ops->copy_heap_tuple(slot);
503 }
504 
505 /*
506  * ExecCopySlotMinimalTuple - return MinimalTuple allocated in caller's context
507  */
508 static inline MinimalTuple
510 {
511  return slot->tts_ops->copy_minimal_tuple(slot);
512 }
513 
514 /*
515  * ExecCopySlot - copy one slot's contents into another.
516  *
517  * If a source's system attributes are supposed to be accessed in the target
518  * slot, the target slot and source slot types need to match.
519  */
520 static inline TupleTableSlot *
522 {
523  Assert(!TTS_EMPTY(srcslot));
524  Assert(srcslot != dstslot);
525 
526  dstslot->tts_ops->copyslot(dstslot, srcslot);
527 
528  return dstslot;
529 }
530 
531 #endif /* FRONTEND */
532 
533 #endif /* TUPTABLE_H */
int16 AttrNumber
Definition: attnum.h:21
int Buffer
Definition: buf.h:23
unsigned short uint16
Definition: c.h:489
unsigned int uint32
Definition: c.h:490
#define PGDLLIMPORT
Definition: c.h:1303
HeapTupleData * HeapTuple
Definition: htup.h:71
MinimalTupleData * MinimalTuple
Definition: htup.h:27
Assert(fmt[strlen(fmt) - 1] !='\n')
NodeTag
Definition: nodes.h:27
int16 attnum
Definition: pg_attribute.h:74
void * arg
static Datum PointerGetDatum(const void *X)
Definition: postgres.h:322
uintptr_t Datum
Definition: postgres.h:64
static Datum ObjectIdGetDatum(Oid X)
Definition: postgres.h:252
unsigned int Oid
Definition: postgres_ext.h:31
pg_node_attr(abstract) HeapTupleTableSlot base
pg_node_attr(abstract) TupleTableSlot base
HeapTupleData tupdata
Definition: tuptable.h:257
HeapTuple tuple
Definition: tuptable.h:254
TupleTableSlot * slot
Definition: tuptable.h:315
Definition: pg_list.h:54
HeapTupleData minhdr
Definition: tuptable.h:292
pg_node_attr(abstract) TupleTableSlot base
MinimalTuple mintuple
Definition: tuptable.h:291
Datum(* getsysattr)(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:168
size_t base_slot_size
Definition: tuptable.h:138
HeapTuple(* get_heap_tuple)(TupleTableSlot *slot)
Definition: tuptable.h:188
void(* init)(TupleTableSlot *slot)
Definition: tuptable.h:141
void(* copyslot)(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
Definition: tuptable.h:180
MinimalTuple(* copy_minimal_tuple)(TupleTableSlot *slot)
Definition: tuptable.h:216
void(* getsomeattrs)(TupleTableSlot *slot, int natts)
Definition: tuptable.h:161
HeapTuple(* copy_heap_tuple)(TupleTableSlot *slot)
Definition: tuptable.h:206
MinimalTuple(* get_minimal_tuple)(TupleTableSlot *slot)
Definition: tuptable.h:196
void(* clear)(TupleTableSlot *slot)
Definition: tuptable.h:152
void(* materialize)(TupleTableSlot *slot)
Definition: tuptable.h:174
void(* release)(TupleTableSlot *slot)
Definition: tuptable.h:144
Oid tts_tableOid
Definition: tuptable.h:131
TupleDesc tts_tupleDescriptor
Definition: tuptable.h:124
const TupleTableSlotOps *const tts_ops
Definition: tuptable.h:122
NodeTag type
Definition: tuptable.h:117
MemoryContext tts_mcxt
Definition: tuptable.h:129
AttrNumber tts_nvalid
Definition: tuptable.h:121
bool * tts_isnull
Definition: tuptable.h:128
ItemPointerData tts_tid
Definition: tuptable.h:130
Datum * tts_values
Definition: tuptable.h:126
uint16 tts_flags
Definition: tuptable.h:119
pg_node_attr(abstract) TupleTableSlot base
#define TableOidAttributeNumber
Definition: sysattr.h:26
#define SelfItemPointerAttributeNumber
Definition: sysattr.h:21
PGDLLIMPORT const TupleTableSlotOps TTSOpsMinimalTuple
Definition: execTuples.c:85
void ExecResetTupleTable(List *tupleTable, bool shouldFree)
Definition: execTuples.c:1192
struct TupleTableSlot TupleTableSlot
TupleTableSlot * MakeTupleTableSlot(TupleDesc tupleDesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1113
static MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot *slot)
Definition: tuptable.h:509
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:471
TupleTableSlot * ExecStoreVirtualTuple(TupleTableSlot *slot)
Definition: execTuples.c:1553
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
Definition: execTuples.c:1255
#define TTS_EMPTY(slot)
Definition: tuptable.h:97
TupleTableSlot * ExecStoreBufferHeapTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer)
Definition: execTuples.c:1393
static void slot_getsomeattrs(TupleTableSlot *slot, int attnum)
Definition: tuptable.h:387
struct MinimalTupleTableSlot MinimalTupleTableSlot
static TupleTableSlot * ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
Definition: tuptable.h:521
void ExecForceStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
Definition: execTuples.c:1513
static HeapTuple ExecCopySlotHeapTuple(TupleTableSlot *slot)
Definition: tuptable.h:498
MinimalTuple ExecFetchSlotMinimalTuple(TupleTableSlot *slot, bool *shouldFree)
Definition: execTuples.c:1693
TupleTableSlot * ExecStoreAllNullTuple(TupleTableSlot *slot)
Definition: execTuples.c:1577
static Datum slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:448
TupleTableSlot * ExecStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
Definition: execTuples.c:1447
PGDLLIMPORT const TupleTableSlotOps TTSOpsVirtual
Definition: execTuples.c:83
HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree)
Definition: execTuples.c:1645
void slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, int lastAttNum)
Definition: execTuples.c:1869
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:427
TupleTableSlot * ExecStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
Definition: execTuples.c:1353
void ExecStoreHeapTupleDatum(Datum data, TupleTableSlot *slot)
Definition: execTuples.c:1607
void ExecSetSlotDescriptor(TupleTableSlot *slot, TupleDesc tupdesc)
Definition: execTuples.c:1290
PGDLLIMPORT const TupleTableSlotOps TTSOpsHeapTuple
Definition: execTuples.c:84
Datum ExecFetchSlotHeapTupleDatum(TupleTableSlot *slot)
Definition: execTuples.c:1724
static void slot_getallattrs(TupleTableSlot *slot)
Definition: tuptable.h:400
void slot_getsomeattrs_int(TupleTableSlot *slot, int attnum)
Definition: execTuples.c:1903
struct HeapTupleTableSlot HeapTupleTableSlot
TupleTableSlot * ExecStorePinnedBufferHeapTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer)
Definition: execTuples.c:1419
PGDLLIMPORT const TupleTableSlotOps TTSOpsBufferHeapTuple
Definition: execTuples.c:86
static void ExecMaterializeSlot(TupleTableSlot *slot)
Definition: tuptable.h:489
TupleTableSlot * ExecAllocTableSlot(List **tupleTable, TupleDesc desc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1172
static bool slot_attisnull(TupleTableSlot *slot, int attnum)
Definition: tuptable.h:413
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1239
void ExecForceStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
Definition: execTuples.c:1470