mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user