diff options
author | Tom Lane | 2006-03-23 00:19:30 +0000 |
---|---|---|
committer | Tom Lane | 2006-03-23 00:19:30 +0000 |
commit | 19956e0d5388b11a1cc3eaf2dbf628aa531ce331 (patch) | |
tree | f2c7071f4daee4588d4c004d809bd327baa4adde /src/backend/utils/adt/not_in.c | |
parent | a3f0b3d68f9a5357a3f72b40a45bcc714a9e0649 (diff) |
Add error location info to ResTarget parse nodes. Allows error cursor to be supplied
for various mistakes involving INSERT and UPDATE target columns.
Diffstat (limited to 'src/backend/utils/adt/not_in.c')
-rw-r--r-- | src/backend/utils/adt/not_in.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/utils/adt/not_in.c b/src/backend/utils/adt/not_in.c index 1a53311e862..df034320221 100644 --- a/src/backend/utils/adt/not_in.c +++ b/src/backend/utils/adt/not_in.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/not_in.c,v 1.44 2006/03/05 15:58:43 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/not_in.c,v 1.45 2006/03/23 00:19:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -72,6 +72,12 @@ int4notin(PG_FUNCTION_ARGS) /* Find the column to search */ attrid = attnameAttNum(relation_to_scan, attribute, true); + if (attrid == InvalidAttrNumber) + ereport(ERROR, + (errcode(ERRCODE_UNDEFINED_COLUMN), + errmsg("column \"%s\" of relation \"%s\" does not exist", + attribute, + RelationGetRelationName(relation_to_scan)))); scan_descriptor = heap_beginscan(relation_to_scan, SnapshotNow, 0, (ScanKey) NULL); |