1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

Add error location info to ResTarget parse nodes. Allows error cursor to be supplied

for various mistakes involving INSERT and UPDATE target columns.
This commit is contained in:
Tom Lane
2006-03-23 00:19:30 +00:00
parent a3f0b3d68f
commit 19956e0d53
13 changed files with 132 additions and 42 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.121 2006/03/16 00:31:55 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.122 2006/03/23 00:19:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1703,7 +1703,9 @@ get_tle_by_resno(List *tlist, AttrNumber resno)
}
/*
* given relation and att name, return id of variable
* given relation and att name, return attnum of variable
*
* Returns InvalidAttrNumber if the attr doesn't exist (or is dropped).
*
* This should only be used if the relation is already
* heap_open()'ed. Use the cache version get_attnum()
@ -1732,11 +1734,7 @@ attnameAttNum(Relation rd, const char *attname, bool sysColOK)
}
/* on failure */
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("column \"%s\" of relation \"%s\" does not exist",
attname, RelationGetRelationName(rd))));
return InvalidAttrNumber; /* keep compiler quiet */
return InvalidAttrNumber;
}
/* specialAttNum()