diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-25 03:08:29 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-25 03:08:29 +0000 |
commit | 02ca529dd8a8f4a102c857120ce6869bad4676f9 (patch) | |
tree | 338a9da014e93357741ce8cdbab9ccb4be9a4322 /src/backend/parser/parse_target.c | |
parent | 0636d55843b7e042aa6088f031926317c1c6212c (diff) | |
download | postgresql-02ca529dd8a8f4a102c857120ce6869bad4676f9.tar.gz postgresql-02ca529dd8a8f4a102c857120ce6869bad4676f9.zip |
Make error message more verbose, in hopes of avoiding misunderstandings
such as bug #1293.
Diffstat (limited to 'src/backend/parser/parse_target.c')
-rw-r--r-- | src/backend/parser/parse_target.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c index b130a842aff..788f6f4dfa6 100644 --- a/src/backend/parser/parse_target.c +++ b/src/backend/parser/parse_target.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.126 2004/09/30 00:24:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.127 2004/10/25 03:08:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -486,15 +486,17 @@ transformAssignmentIndirection(ParseState *pstate, if (!typrelid) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), - errmsg("cannot assign to a column of type %s because it is not a composite type", + errmsg("cannot assign to field \"%s\" of column \"%s\" because its type %s is not a composite type", + strVal(n), targetName, format_type_be(targetTypeId)))); attnum = get_attnum(typrelid, strVal(n)); if (attnum == InvalidAttrNumber) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), - errmsg("column \"%s\" not found in data type %s", - strVal(n), format_type_be(targetTypeId)))); + errmsg("cannot assign to field \"%s\" of column \"%s\" because there is no such column in data type %s", + strVal(n), targetName, + format_type_be(targetTypeId)))); if (attnum < 0) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), |