diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/nodes.h | 4 | ||||
| -rw-r--r-- | src/include/nodes/parsenodes.h | 18 | ||||
| -rw-r--r-- | src/include/parser/parse_coerce.h | 8 |
3 files changed, 24 insertions, 6 deletions
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 219bcbe6f6a..a6df5f1417a 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: nodes.h,v 1.61 2000/01/16 20:04:58 petere Exp $ + * $Id: nodes.h,v 1.62 2000/01/17 00:14:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -202,7 +202,7 @@ typedef enum NodeTag T_FuncCall, T_A_Indices, T_ResTarget, - T_ParamString, /* not used anymore */ + T_TypeCast, T_RelExpr, T_SortGroupBy, T_RangeVar, diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 53c55be4db7..b1fc802d883 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: parsenodes.h,v 1.94 2000/01/16 20:04:58 petere Exp $ + * $Id: parsenodes.h,v 1.95 2000/01/17 00:14:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -869,6 +869,22 @@ typedef struct A_Const } A_Const; /* + * TypeCast - a CAST expression + * + * NOTE: for mostly historical reasons, A_Const and ParamNo parsenodes contain + * room for a TypeName; we only generate a separate TypeCast node if the + * argument to be casted is neither of those kinds of nodes. In theory either + * representation would work, but it is convenient (especially for A_Const) + * to have the target type immediately available. + */ +typedef struct TypeCast +{ + NodeTag type; + Node *arg; /* the expression being casted */ + TypeName *typename; /* the target type */ +} TypeCast; + +/* * CaseExpr - a CASE expression */ typedef struct CaseExpr diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h index 02a1eed11e7..06736c6dff9 100644 --- a/src/include/parser/parse_coerce.h +++ b/src/include/parser/parse_coerce.h @@ -2,11 +2,11 @@ * * parse_coerce.h * - * + * Routines for type coercion. * * Copyright (c) 1994, Regents of the University of California * - * $Id: parse_coerce.h,v 1.15 1999/07/16 17:07:36 momjian Exp $ + * $Id: parse_coerce.h,v 1.16 2000/01/17 00:14:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -125,6 +125,8 @@ extern CATEGORY TypeCategory(Oid type); extern bool can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids); extern Node *coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, - Oid targetTypeId, int32 atttypmod); + Oid targetTypeId, int32 atttypmod); +extern Node *coerce_type_typmod(ParseState *pstate, Node *node, + Oid targetTypeId, int32 atttypmod); #endif /* PARSE_COERCE_H */ |
