diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-29 22:13:11 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-29 22:13:11 +0000 |
commit | aa282d44464df0fbfa0672dc353d36734ec1092e (patch) | |
tree | dbf42be31346c6716bc33e73e801cda670fc60e4 /src/include/parser/parse_coerce.h | |
parent | 19141f558411e96446294baf240eaeccf6d68b64 (diff) |
Infrastructure for deducing Param types from context, in the same way
that the types of untyped string-literal constants are deduced (ie,
when coerce_type is applied to 'em, that's what the type must be).
Remove the ancient hack of storing the input Param-types array as a
global variable, and put the info into ParseState instead. This touches
a lot of files because of adjustment of routine parameter lists, but
it's really not a large patch. Note: PREPARE statement still insists on
exact specification of parameter types, but that could easily be relaxed
now, if we wanted to do so.
Diffstat (limited to 'src/include/parser/parse_coerce.h')
-rw-r--r-- | src/include/parser/parse_coerce.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h index b21a83601bf..de2ea95db85 100644 --- a/src/include/parser/parse_coerce.h +++ b/src/include/parser/parse_coerce.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parse_coerce.h,v 1.50 2003/04/08 23:20:04 tgl Exp $ + * $Id: parse_coerce.h,v 1.51 2003/04/29 22:13:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,6 +17,7 @@ #include "catalog/pg_type.h" #include "parser/parse_node.h" + typedef enum CATEGORY { INVALID_TYPE, @@ -38,22 +39,26 @@ extern bool IsBinaryCoercible(Oid srctype, Oid targettype); extern bool IsPreferredType(CATEGORY category, Oid type); extern CATEGORY TypeCategory(Oid type); -extern Node *coerce_to_target_type(Node *expr, Oid exprtype, +extern Node *coerce_to_target_type(ParseState *pstate, + Node *expr, Oid exprtype, Oid targettype, int32 targettypmod, CoercionContext ccontext, CoercionForm cformat); extern bool can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids, CoercionContext ccontext); -extern Node *coerce_type(Node *node, Oid inputTypeId, Oid targetTypeId, +extern Node *coerce_type(ParseState *pstate, Node *node, + Oid inputTypeId, Oid targetTypeId, CoercionContext ccontext, CoercionForm cformat); extern Node *coerce_to_domain(Node *arg, Oid baseTypeId, Oid typeId, CoercionForm cformat); -extern Node *coerce_to_boolean(Node *node, const char *constructName); +extern Node *coerce_to_boolean(ParseState *pstate, Node *node, + const char *constructName); extern Oid select_common_type(List *typeids, const char *context); -extern Node *coerce_to_common_type(Node *node, Oid targetTypeId, - const char *context); +extern Node *coerce_to_common_type(ParseState *pstate, Node *node, + Oid targetTypeId, + const char *context); extern bool check_generic_type_consistency(Oid *actual_arg_types, Oid *declared_arg_types, |