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-2020, 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 
22 
23 typedef struct TupleConversionMap
24 {
25  TupleDesc indesc; /* tupdesc for source rowtype */
26  TupleDesc outdesc; /* tupdesc for result rowtype */
27  AttrMap *attrMap; /* indexes of input fields, or 0 for null */
28  Datum *invalues; /* workspace for deconstructing source */
29  bool *inisnull;
30  Datum *outvalues; /* workspace for constructing result */
31  bool *outisnull;
33 
34 
37  const char *msg);
38 
41 
44  TupleTableSlot *in_slot,
45  TupleTableSlot *out_slot);
46 
47 extern void free_conversion_map(TupleConversionMap *map);
48 
49 #endif /* TUPCONVERT_H */
TupleDesc indesc
Definition: tupconvert.h:25
TupleDesc outdesc
Definition: tupconvert.h:26
void free_conversion_map(TupleConversionMap *map)
Definition: tupconvert.c:233
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:27
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