From: Alvaro Herrera Date: Mon, 27 Feb 2023 16:04:05 +0100 Subject: [PATCH v3 1/3] ALTER TABLE ADD PRIMARY KEY: mention table name in 'NOT NULL missing' error --- src/backend/catalog/index.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 7777e7ec77..bdf78b53ea 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -269,8 +269,8 @@ index_check_primary_key(Relation heapRel, if (!attform->attnotnull) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), - errmsg("primary key column \"%s\" is not marked NOT NULL", - NameStr(attform->attname)))); + errmsg("primary key column \"%s\" is not marked NOT NULL in table \"%s\"", + NameStr(attform->attname), RelationGetRelationName(heapRel)))); ReleaseSysCache(atttuple); } -- 2.30.2 --vznfmouvfpk5fnl5 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v3-0002-Rebase-of-catalog-notnull-6-minus-psql-d-changes.patch"