mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +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:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.92 2006/03/05 15:58:23 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.93 2006/03/23 00:19:28 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -216,6 +216,11 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt)
|
||||
char *col = strVal(lfirst(le));
|
||||
|
||||
i = attnameAttNum(onerel, col, false);
|
||||
if (i == InvalidAttrNumber)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_COLUMN),
|
||||
errmsg("column \"%s\" of relation \"%s\" does not exist",
|
||||
col, RelationGetRelationName(onerel))));
|
||||
vacattrstats[tcnt] = examine_attribute(onerel, i);
|
||||
if (vacattrstats[tcnt] != NULL)
|
||||
tcnt++;
|
||||
|
Reference in New Issue
Block a user