aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-04-29 22:13:11 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-04-29 22:13:11 +0000
commitaa282d44464df0fbfa0672dc353d36734ec1092e (patch)
treedbf42be31346c6716bc33e73e801cda670fc60e4 /src/backend/parser/parse_target.c
parent19141f558411e96446294baf240eaeccf6d68b64 (diff)
downloadpostgresql-aa282d44464df0fbfa0672dc353d36734ec1092e.tar.gz
postgresql-aa282d44464df0fbfa0672dc353d36734ec1092e.zip
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/backend/parser/parse_target.c')
-rw-r--r--src/backend/parser/parse_target.c7
1 files changed, 4 insertions, 3 deletions
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);