PostgreSQL Source Code  git master
tupconvert.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tupconvert.h
4  * Tuple conversion support.
5  *
6  *
7  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/access/tupconvert.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TUPCONVERT_H
15 #define TUPCONVERT_H
16 
17 #include "access/attmap.h"
18 #include "access/htup.h"
19 #include "access/tupdesc.h"
20 #include "executor/tuptable.h"
21 #include "nodes/bitmapset.h"
22 
23 
24 typedef struct TupleConversionMap
25 {
26  TupleDesc indesc; /* tupdesc for source rowtype */
27  TupleDesc outdesc; /* tupdesc for result rowtype */
28  AttrMap *attrMap; /* indexes of input fields, or 0 for null */
29  Datum *invalues; /* workspace for deconstructing source */
30  bool *inisnull;
31  Datum *outvalues; /* workspace for constructing result */
32  bool *outisnull;
34 
35 
38  const char *msg);
39 
42 
45  TupleTableSlot *in_slot,
46  TupleTableSlot *out_slot);
48 
49 extern void free_conversion_map(TupleConversionMap *map);
50 
51 #endif /* TUPCONVERT_H */
TupleDesc indesc
Definition: tupconvert.h:26
TupleDesc outdesc
Definition: tupconvert.h:27
void free_conversion_map(TupleConversionMap *map)
Definition: tupconvert.c:284
Bitmapset * execute_attr_map_cols(AttrMap *attrMap, Bitmapset *inbitmap)
Definition: tupconvert.c:237
Definition: attmap.h:34
struct TupleConversionMap TupleConversionMap
TupleConversionMap * convert_tuples_by_name(TupleDesc indesc, TupleDesc outdesc)
Definition: tupconvert.c:102
TupleConversionMap * convert_tuples_by_position(TupleDesc indesc, TupleDesc outdesc, const char *msg)
Definition: tupconvert.c:59
AttrMap * attrMap
Definition: tupconvert.h:28
HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map)
Definition: tupconvert.c:139
uintptr_t Datum
Definition: postgres.h:367
TupleTableSlot * execute_attr_map_slot(AttrMap *attrMap, TupleTableSlot *in_slot, TupleTableSlot *out_slot)
Definition: tupconvert.c:177