From aa282d44464df0fbfa0672dc353d36734ec1092e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 29 Apr 2003 22:13:11 +0000 Subject: 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. --- src/backend/parser/parse_target.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/backend/parser/parse_target.c') diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c index e1be47b3ec5..dc8f241d45e 100644 --- a/src/backend/parser/parse_target.c +++ b/src/backend/parser/parse_target.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.99 2003/04/08 23:20:02 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.100 2003/04/29 22:13:10 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -73,7 +73,7 @@ transformTargetEntry(ParseState *pstate, colname = FigureColname(node); } - resnode = makeResdom((AttrNumber) pstate->p_last_resno++, + resnode = makeResdom((AttrNumber) pstate->p_next_resno++, type_id, type_mod, colname, @@ -290,7 +290,8 @@ updateTargetListEntry(ParseState *pstate, if (type_id != InvalidOid) { tle->expr = (Expr *) - coerce_to_target_type((Node *) tle->expr, type_id, + coerce_to_target_type(pstate, + (Node *) tle->expr, type_id, attrtype, attrtypmod, COERCION_ASSIGNMENT, COERCE_IMPLICIT_CAST); -- cgit v1.2.3