1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-13 16:22:44 +03:00

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.
This commit is contained in:
Tom Lane
2000-01-17 02:04:16 +00:00
parent ceca03600e
commit ac4878a060
7 changed files with 27 additions and 24 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.115 2000/01/16 19:57:00 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.116 2000/01/17 02:04:12 tgl Exp $
*
*
* INTERFACE ROUTINES
@@ -1966,8 +1966,8 @@ AddRelationRawConstraints(Relation rel,
if (type_id != atp->atttypid)
{
if (CoerceTargetExpr(NULL, expr,
type_id, atp->atttypid) == NULL)
if (CoerceTargetExpr(NULL, expr, type_id,
atp->atttypid, atp->atttypmod) == NULL)
elog(ERROR, "Attribute '%s' is of type '%s'"
" but default expression is of type '%s'"
"\n\tYou will need to rewrite or cast the expression",