PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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-2024, 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 
37  TupleDesc outdesc,
38  const char *msg);
39 
41  TupleDesc outdesc);
43  TupleDesc outdesc,
44  AttrMap *attrMap);
45 
48  TupleTableSlot *in_slot,
49  TupleTableSlot *out_slot);
50 extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *in_cols);
51 
52 extern void free_conversion_map(TupleConversionMap *map);
53 
54 #endif /* TUPCONVERT_H */
uintptr_t Datum
Definition: postgres.h:64
Definition: attmap.h:35
AttrMap * attrMap
Definition: tupconvert.h:28
TupleDesc outdesc
Definition: tupconvert.h:27
TupleDesc indesc
Definition: tupconvert.h:26
Bitmapset * execute_attr_map_cols(AttrMap *attrMap, Bitmapset *in_cols)
Definition: tupconvert.c:252
TupleConversionMap * convert_tuples_by_position(TupleDesc indesc, TupleDesc outdesc, const char *msg)
Definition: tupconvert.c:59
TupleTableSlot * execute_attr_map_slot(AttrMap *attrMap, TupleTableSlot *in_slot, TupleTableSlot *out_slot)
Definition: tupconvert.c:192
void free_conversion_map(TupleConversionMap *map)
Definition: tupconvert.c:299
struct TupleConversionMap TupleConversionMap
TupleConversionMap * convert_tuples_by_name_attrmap(TupleDesc indesc, TupleDesc outdesc, AttrMap *attrMap)
Definition: tupconvert.c:124
TupleConversionMap * convert_tuples_by_name(TupleDesc indesc, TupleDesc outdesc)
Definition: tupconvert.c:102
HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map)
Definition: tupconvert.c:154