PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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-2017, 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 
20 
21 typedef struct TupleConversionMap
22 {
23  TupleDesc indesc; /* tupdesc for source rowtype */
24  TupleDesc outdesc; /* tupdesc for result rowtype */
25  AttrNumber *attrMap; /* indexes of input fields, or 0 for null */
26  Datum *invalues; /* workspace for deconstructing source */
27  bool *inisnull;
28  Datum *outvalues; /* workspace for constructing result */
29  bool *outisnull;
31 
32 
34  TupleDesc outdesc,
35  const char *msg);
36 
38  TupleDesc outdesc,
39  const char *msg);
40 
42  TupleDesc outdesc,
43  const char *msg);
44 
46 
47 extern void free_conversion_map(TupleConversionMap *map);
48 
49 #endif /* TUPCONVERT_H */
AttrNumber * attrMap
Definition: tupconvert.h:25
TupleDesc indesc
Definition: tupconvert.h:23
TupleConversionMap * convert_tuples_by_name(TupleDesc indesc, TupleDesc outdesc, const char *msg)
Definition: tupconvert.c:210
TupleDesc outdesc
Definition: tupconvert.h:24
void free_conversion_map(TupleConversionMap *map)
Definition: tupconvert.c:392
struct TupleConversionMap TupleConversionMap
TupleConversionMap * convert_tuples_by_position(TupleDesc indesc, TupleDesc outdesc, const char *msg)
Definition: tupconvert.c:66
uintptr_t Datum
Definition: postgres.h:372
AttrNumber * convert_tuples_by_name_map(TupleDesc indesc, TupleDesc outdesc, const char *msg)
Definition: tupconvert.c:293
HeapTuple do_convert_tuple(HeapTuple tuple, TupleConversionMap *map)
Definition: tupconvert.c:354
int16 AttrNumber
Definition: attnum.h:21