From 19956e0d5388b11a1cc3eaf2dbf628aa531ce331 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 23 Mar 2006 00:19:30 +0000 Subject: Add error location info to ResTarget parse nodes. Allows error cursor to be supplied for various mistakes involving INSERT and UPDATE target columns. --- src/backend/utils/adt/not_in.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/adt/not_in.c') diff --git a/src/backend/utils/adt/not_in.c b/src/backend/utils/adt/not_in.c index 1a53311e86..df03432022 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); -- cgit v1.2.1