]> granicus.if.org Git - postgresql/commitdiff
Improve two error messages
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 18 May 2018 21:17:57 +0000 (17:17 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 12 Jul 2018 10:35:59 +0000 (12:35 +0200)
src/backend/parser/parse_utilcmd.c
src/bin/pg_upgrade/check.c

index 17b54b20cccc1434af13d79192cf8f37b9e56722..656b1b5f1b4d49c88adcce069c112fbaee7341de 100644 (file)
@@ -2098,7 +2098,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
                                        index_rel->rd_indoption[i] != 0)
                                        ereport(ERROR,
                                                        (errcode(ERRCODE_WRONG_OBJECT_TYPE),
-                                                        errmsg("index \"%s\" does not have default sorting behavior", index_name),
+                                                        errmsg("index \"%s\" column number %d does not have default sorting behavior", index_name, i + 1),
                                                         errdetail("Cannot create a primary key or unique constraint using such an index."),
                                                         parser_errposition(cxt->pstate, constraint->location)));
 
index 577db73f100639a5bd91e0eb0f497fc4ce28559a..5a78d603dc92c42c81601833cd09c12b02e475ca 100644 (file)
@@ -382,8 +382,10 @@ check_new_cluster_is_empty(void)
                {
                        /* pg_largeobject and its index should be skipped */
                        if (strcmp(rel_arr->rels[relnum].nspname, "pg_catalog") != 0)
-                               pg_fatal("New cluster database \"%s\" is not empty\n",
-                                                new_cluster.dbarr.dbs[dbnum].db_name);
+                               pg_fatal("New cluster database \"%s\" is not empty: found relation \"%s.%s\"\n",
+                                                new_cluster.dbarr.dbs[dbnum].db_name,
+                                                rel_arr->rels[relnum].nspname,
+                                                rel_arr->rels[relnum].relname);
                }
        }
 }