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-2019, 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/htup.h"
18 #include "access/tupdesc.h"
19 #include "executor/tuptable.h"
20 
21 
22 typedef struct TupleConversionMap
23 {
24  TupleDesc indesc; /* tupdesc for source rowtype */
25  TupleDesc outdesc; /* tupdesc for result rowtype */
26  AttrNumber *attrMap; /* indexes of input fields, or 0 for null */
27  Datum *invalues; /* workspace for deconstructing source */
28  bool *inisnull;
29  Datum *outvalues; /* workspace for constructing result */
30  bool *outisnull;
32 
33 
36  const char *msg);
37 
40 
45 
48  TupleTableSlot *in_slot, TupleTableSlot *out_slot);
49 
50 extern void free_conversion_map(TupleConversionMap *map);
51 
52 #endif /* TUPCONVERT_H */
AttrNumber * attrMap
Definition: tupconvert.h:26
TupleDesc indesc
Definition: tupconvert.h:24
TupleDesc outdesc
Definition: tupconvert.h:25
AttrNumber * convert_tuples_by_name_map(TupleDesc indesc, TupleDesc outdesc)
Definition: tupconvert.c:245
void free_conversion_map(TupleConversionMap *map)
Definition: tupconvert.c:481
TupleTableSlot * execute_attr_map_slot(AttrNumber *attrMap, TupleTableSlot *in_slot, TupleTableSlot *out_slot)
Definition: tupconvert.c:425
AttrNumber * convert_tuples_by_name_map_if_req(TupleDesc indesc, TupleDesc outdesc)
Definition: tupconvert.c:327
struct TupleConversionMap TupleConversionMap
TupleConversionMap * convert_tuples_by_name(TupleDesc indesc, TupleDesc outdesc)
Definition: tupconvert.c:205
TupleConversionMap * convert_tuples_by_position(TupleDesc indesc, TupleDesc outdesc, const char *msg)
Definition: tupconvert.c:65
HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map)
Definition: tupconvert.c:387
uintptr_t Datum
Definition: postgres.h:367
int16 AttrNumber
Definition: attnum.h:21