1 /*-------------------------------------------------------------------------
4 * Tuple conversion support.
7 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/access/tupconvert.h
12 *-------------------------------------------------------------------------
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"
24 typedef struct TupleConversionMap
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 */
31 Datum
*outvalues
; /* workspace for constructing result */
36 extern TupleConversionMap
*convert_tuples_by_position(TupleDesc indesc
,
40 extern TupleConversionMap
*convert_tuples_by_name(TupleDesc indesc
,
43 extern HeapTuple
execute_attr_map_tuple(HeapTuple tuple
, TupleConversionMap
*map
);
44 extern TupleTableSlot
*execute_attr_map_slot(AttrMap
*attrMap
,
45 TupleTableSlot
*in_slot
,
46 TupleTableSlot
*out_slot
);
47 extern Bitmapset
*execute_attr_map_cols(AttrMap
*attrMap
, Bitmapset
*inbitmap
);
49 extern void free_conversion_map(TupleConversionMap
*map
);
51 #endif /* TUPCONVERT_H */