diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/tupconvert.h | 44 | ||||
-rw-r--r-- | src/include/nodes/execnodes.h | 10 |
2 files changed, 48 insertions, 6 deletions
diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h new file mode 100644 index 00000000000..7eb0f7fbc95 --- /dev/null +++ b/src/include/access/tupconvert.h @@ -0,0 +1,44 @@ +/*------------------------------------------------------------------------- + * + * tupconvert.h + * Tuple conversion support. + * + * + * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * $PostgreSQL: pgsql/src/include/access/tupconvert.h,v 1.1 2009/08/06 20:44:31 tgl Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef TUPCONVERT_H +#define TUPCONVERT_H + +#include "access/htup.h" + + +typedef struct TupleConversionMap +{ + TupleDesc indesc; /* tupdesc for source rowtype */ + TupleDesc outdesc; /* tupdesc for result rowtype */ + AttrNumber *attrMap; /* indexes of input fields, or 0 for null */ + Datum *invalues; /* workspace for deconstructing source */ + bool *inisnull; + Datum *outvalues; /* workspace for constructing result */ + bool *outisnull; +} TupleConversionMap; + + +extern TupleConversionMap *convert_tuples_by_position(TupleDesc indesc, + TupleDesc outdesc, + const char *msg); + +extern TupleConversionMap *convert_tuples_by_name(TupleDesc indesc, + TupleDesc outdesc, + const char *msg); + +extern HeapTuple do_convert_tuple(HeapTuple tuple, TupleConversionMap *map); + +extern void free_conversion_map(TupleConversionMap *map); + +#endif /* TUPCONVERT_H */ diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index b74db12afcb..1b60bda4691 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.205 2009/06/11 14:49:11 momjian Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.206 2009/08/06 20:44:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -750,11 +750,9 @@ typedef struct ConvertRowtypeExprState ExprState *arg; /* input tuple value */ TupleDesc indesc; /* tupdesc for source rowtype */ TupleDesc outdesc; /* tupdesc for result rowtype */ - AttrNumber *attrMap; /* indexes of input fields, or 0 for null */ - Datum *invalues; /* workspace for deconstructing source */ - bool *inisnull; - Datum *outvalues; /* workspace for constructing result */ - bool *outisnull; + /* use "struct" so we needn't include tupconvert.h here */ + struct TupleConversionMap *map; + bool initialized; } ConvertRowtypeExprState; /* ---------------- |