diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/nodes/execnodes.h | 19 | ||||
-rw-r--r-- | src/include/nodes/nodes.h | 4 | ||||
-rw-r--r-- | src/include/nodes/primnodes.h | 23 |
3 files changed, 43 insertions, 3 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 07176952032..7b5a75868ba 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.120 2004/10/07 18:38:51 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.121 2004/12/11 23:26:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -579,6 +579,23 @@ typedef struct FieldStoreState } FieldStoreState; /* ---------------- + * ConvertRowtypeExprState node + * ---------------- + */ +typedef struct ConvertRowtypeExprState +{ + ExprState xprstate; + 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 */ + char *innulls; + Datum *outvalues; /* workspace for constructing result */ + char *outnulls; +} ConvertRowtypeExprState; + +/* ---------------- * CaseExprState node * ---------------- */ diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 4a7cf05e5c5..5cd41088589 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.161 2004/09/14 03:21:25 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.162 2004/12/11 23:26:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -112,6 +112,7 @@ typedef enum NodeTag T_FieldSelect, T_FieldStore, T_RelabelType, + T_ConvertRowtypeExpr, T_CaseExpr, T_CaseWhen, T_CaseTestExpr, @@ -145,6 +146,7 @@ typedef enum NodeTag T_SubPlanState, T_FieldSelectState, T_FieldStoreState, + T_ConvertRowtypeExprState, T_CaseExprState, T_CaseWhenState, T_ArrayExprState, diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 9eb1514c288..789cc83893f 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.104 2004/08/29 05:06:57 momjian Exp $ + * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.105 2004/12/11 23:26:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -591,6 +591,27 @@ typedef struct RelabelType CoercionForm relabelformat; /* how to display this node */ } RelabelType; +/* ---------------- + * ConvertRowtypeExpr + * + * ConvertRowtypeExpr represents a type coercion from one composite type + * to another, where the source type is guaranteed to contain all the columns + * needed for the destination type plus possibly others; the columns need not + * be in the same positions, but are matched up by name. This is primarily + * used to convert a whole-row value of an inheritance child table into a + * valid whole-row value of its parent table's rowtype. + * ---------------- + */ + +typedef struct ConvertRowtypeExpr +{ + Expr xpr; + Expr *arg; /* input expression */ + Oid resulttype; /* output type (always a composite type) */ + /* result typmod is not stored, but must be -1; see RowExpr comments */ + CoercionForm convertformat; /* how to display this node */ +} ConvertRowtypeExpr; + /*---------- * CaseExpr - a CASE expression * |