pg_upgrade: Message improvements

This commit is contained in:
Peter Eisentraut 2026-05-11 11:38:20 +02:00
parent 901ed9b352
commit c1fe2d1a38

View file

@ -985,7 +985,7 @@ check_for_new_tablespace_dir(void)
int tblnum; int tblnum;
char new_tablespace_dir[MAXPGPATH]; char new_tablespace_dir[MAXPGPATH];
prep_status("Checking for new cluster tablespace directories"); prep_status("Checking new cluster tablespace directories");
for (tblnum = 0; tblnum < new_cluster.num_tablespaces; tblnum++) for (tblnum = 0; tblnum < new_cluster.num_tablespaces; tblnum++)
{ {
@ -1859,10 +1859,10 @@ check_for_gist_inet_ops(ClusterInfo *cluster)
{ {
fclose(report.file); fclose(report.file);
pg_log(PG_REPORT, "fatal"); pg_log(PG_REPORT, "fatal");
pg_fatal("Your installation contains indexes that use btree_gist's\n" pg_fatal("Your installation contains indexes that use btree_gist extension's\n"
"gist_inet_ops or gist_cidr_ops opclasses,\n" "gist_inet_ops or gist_cidr_ops operator classes, which cannot be\n"
"which cannot be binary-upgraded. Replace them with indexes\n" "binary-upgraded. Replace them with indexes that use the built-in GiST\n"
"that use the built-in GiST inet_ops opclass.\n" "inet_ops operator class.\n"
"A list of indexes with the problem is in the file:\n" "A list of indexes with the problem is in the file:\n"
" %s", report.path); " %s", report.path);
} }
@ -2194,11 +2194,11 @@ check_for_unicode_update(ClusterInfo *cluster)
* check_new_cluster_replication_slots() * check_new_cluster_replication_slots()
* *
* Validate the new cluster's readiness for migrating replication slots: * Validate the new cluster's readiness for migrating replication slots:
* - Ensures no existing logical replication slots on the new cluster when * - Ensures no existing logical replication slots in the new cluster when
* migrating logical slots. * migrating logical slots.
* - Ensure conflict detection slot does not exist on the new cluster when * - Ensure conflict detection slot does not exist in the new cluster when
* migrating subscriptions with retain_dead_tuples enabled. * migrating subscriptions with retain_dead_tuples enabled.
* - Ensure that the parameter settings on the new cluster necessary for * - Ensure that the parameter settings in the new cluster necessary for
* creating slots are sufficient. * creating slots are sufficient.
*/ */
static void static void
@ -2232,7 +2232,7 @@ check_new_cluster_replication_slots(void)
conn = connectToServer(&new_cluster, "template1"); conn = connectToServer(&new_cluster, "template1");
prep_status("Checking for new cluster replication slots"); prep_status("Checking new cluster replication slots");
res = executeQueryOrDie(conn, "SELECT %s AS nslots_on_new, %s AS rdt_slot_on_new " res = executeQueryOrDie(conn, "SELECT %s AS nslots_on_new, %s AS rdt_slot_on_new "
"FROM pg_catalog.pg_replication_slots", "FROM pg_catalog.pg_replication_slots",
@ -2263,7 +2263,7 @@ check_new_cluster_replication_slots(void)
if (rdt_slot_on_new) if (rdt_slot_on_new)
{ {
Assert(old_cluster.sub_retain_dead_tuples); Assert(old_cluster.sub_retain_dead_tuples);
pg_fatal("The replication slot \"pg_conflict_detection\" already exists on the new cluster"); pg_fatal("replication slot \"%s\" already exists in the new cluster", "pg_conflict_detection");
} }
PQclear(res); PQclear(res);
@ -2324,7 +2324,7 @@ check_new_cluster_subscription_configuration(void)
if (old_cluster.nsubs == 0) if (old_cluster.nsubs == 0)
return; return;
prep_status("Checking for new cluster configuration for subscriptions"); prep_status("Checking new cluster configuration for subscriptions");
conn = connectToServer(&new_cluster, "template1"); conn = connectToServer(&new_cluster, "template1");
@ -2358,7 +2358,7 @@ check_old_cluster_for_valid_slots(void)
char output_path[MAXPGPATH]; char output_path[MAXPGPATH];
FILE *script = NULL; FILE *script = NULL;
prep_status("Checking for valid logical replication slots"); prep_status("Checking logical replication slots");
snprintf(output_path, sizeof(output_path), "%s/%s", snprintf(output_path, sizeof(output_path), "%s/%s",
log_opts.basedir, log_opts.basedir,
@ -2484,7 +2484,7 @@ check_old_cluster_subscription_state(void)
PGconn *conn; PGconn *conn;
int ntup; int ntup;
prep_status("Checking for subscription state"); prep_status("Checking subscription state");
report.file = NULL; report.file = NULL;
snprintf(report.path, sizeof(report.path), "%s/%s", snprintf(report.path, sizeof(report.path), "%s/%s",
@ -2592,7 +2592,7 @@ check_old_cluster_global_names(ClusterInfo *cluster)
char output_path[MAXPGPATH]; char output_path[MAXPGPATH];
int count = 0; int count = 0;
prep_status("Checking names of databases, roles and tablespaces"); prep_status("Checking names of databases, roles, and tablespaces");
snprintf(output_path, sizeof(output_path), "%s/%s", snprintf(output_path, sizeof(output_path), "%s/%s",
log_opts.basedir, log_opts.basedir,
@ -2635,11 +2635,11 @@ check_old_cluster_global_names(ClusterInfo *cluster)
{ {
fclose(script); fclose(script);
pg_log(PG_REPORT, "fatal"); pg_log(PG_REPORT, "fatal");
pg_fatal("All the database, role and tablespace names should have only valid characters. A newline or \n" pg_fatal("Your installation contains databases, roles, or tablespace with names\n"
"carriage return character is not allowed in these object names. To fix this, please \n" "with invalid characters (newline or carriage return). To fix this,\n"
"rename these names with valid names. \n" "rename these objects.\n"
"To see all %d invalid object names, refer db_role_tablespace_invalid_names.txt file. \n" "A list of all objects with invalid names is in the file:\n"
" %s", count, output_path); " %s", output_path);
} }
else else
check_ok(); check_ok();