Skip to content

Commit 8e59989

Browse files
committed
Improve two error messages
1 parent ecd6b43 commit 8e59989

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/backend/parser/parse_utilcmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
20982098
index_rel->rd_indoption[i] != 0)
20992099
ereport(ERROR,
21002100
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
2101-
errmsg("index \"%s\" does not have default sorting behavior", index_name),
2101+
errmsg("index \"%s\" column number %d does not have default sorting behavior", index_name, i + 1),
21022102
errdetail("Cannot create a primary key or unique constraint using such an index."),
21032103
parser_errposition(cxt->pstate, constraint->location)));
21042104

src/bin/pg_upgrade/check.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,10 @@ check_new_cluster_is_empty(void)
382382
{
383383
/* pg_largeobject and its index should be skipped */
384384
if (strcmp(rel_arr->rels[relnum].nspname, "pg_catalog") != 0)
385-
pg_fatal("New cluster database \"%s\" is not empty\n",
386-
new_cluster.dbarr.dbs[dbnum].db_name);
385+
pg_fatal("New cluster database \"%s\" is not empty: found relation \"%s.%s\"\n",
386+
new_cluster.dbarr.dbs[dbnum].db_name,
387+
rel_arr->rels[relnum].nspname,
388+
rel_arr->rels[relnum].relname);
387389
}
388390
}
389391
}

0 commit comments

Comments
 (0)