aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-01-17 02:04:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-01-17 02:04:16 +0000
commitac4878a06009c34bf26b12f358fc45bef13829bf (patch)
treed26aace1a158c3a4b2a8d28e95adad2dc5a53641 /src/backend/parser/parse_target.c
parentceca03600e4dce4848d712355a720ddad2a5e476 (diff)
downloadpostgresql-ac4878a06009c34bf26b12f358fc45bef13829bf.tar.gz
postgresql-ac4878a06009c34bf26b12f358fc45bef13829bf.zip
Pass atttypmod to CoerceTargetExpr, so that it can pass it on to
coerce_type, so that the right things happen when coercing a previously- unknown constant to a destination data type.
Diffstat (limited to 'src/backend/parser/parse_target.c')
-rw-r--r--src/backend/parser/parse_target.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index f80b6ef4fbb..b6eb7e0b547 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.52 2000/01/17 00:14:48 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.53 2000/01/17 02:04:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -229,8 +229,8 @@ updateTargetListEntry(ParseState *pstate,
{
if (type_id != attrtype)
{
- tle->expr = CoerceTargetExpr(pstate, tle->expr,
- type_id, attrtype);
+ tle->expr = CoerceTargetExpr(pstate, tle->expr, type_id,
+ attrtype, attrtypmod);
if (tle->expr == NULL)
elog(ERROR, "Attribute '%s' is of type '%s'"
" but expression is of type '%s'"
@@ -264,10 +264,11 @@ Node *
CoerceTargetExpr(ParseState *pstate,
Node *expr,
Oid type_id,
- Oid attrtype)
+ Oid attrtype,
+ int32 attrtypmod)
{
if (can_coerce_type(1, &type_id, &attrtype))
- expr = coerce_type(pstate, expr, type_id, attrtype, -1);
+ expr = coerce_type(pstate, expr, type_id, attrtype, attrtypmod);
#ifndef DISABLE_STRING_HACKS
@@ -283,7 +284,7 @@ CoerceTargetExpr(ParseState *pstate,
{
}
else if (can_coerce_type(1, &type_id, &text_id))
- expr = coerce_type(pstate, expr, type_id, text_id, -1);
+ expr = coerce_type(pstate, expr, type_id, text_id, attrtypmod);
else
expr = NULL;
}