提交 02ca529d 编写于 作者: T Tom Lane

Make error message more verbose, in hopes of avoiding misunderstandings

such as bug #1293.
上级 0636d558
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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, ...@@ -486,15 +486,17 @@ transformAssignmentIndirection(ParseState *pstate,
if (!typrelid) if (!typrelid)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH), (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)))); format_type_be(targetTypeId))));
attnum = get_attnum(typrelid, strVal(n)); attnum = get_attnum(typrelid, strVal(n));
if (attnum == InvalidAttrNumber) if (attnum == InvalidAttrNumber)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN), (errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("column \"%s\" not found in data type %s", errmsg("cannot assign to field \"%s\" of column \"%s\" because there is no such column in data type %s",
strVal(n), format_type_be(targetTypeId)))); strVal(n), targetName,
format_type_be(targetTypeId))));
if (attnum < 0) if (attnum < 0)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN), (errcode(ERRCODE_UNDEFINED_COLUMN),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册