Skip to content

Commit bf886df

Browse files
committed
pg_createsubscriber: Message style improvements
1 parent 79c3012 commit bf886df

File tree

2 files changed

+30
-29
lines changed

2 files changed

+30
-29
lines changed

doc/src/sgml/ref/pg_createsubscriber.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ PostgreSQL documentation
8888
<term><option>--database=<replaceable class="parameter">dbname</replaceable></option></term>
8989
<listitem>
9090
<para>
91-
The database name to create the subscription. Multiple databases can
92-
be selected by writing multiple <option>-d</option> switches.
91+
The name of the database in which to create a subscription. Multiple
92+
databases can be selected by writing multiple <option>-d</option>
93+
switches.
9394
</para>
9495
</listitem>
9596
</varlistentry>

src/bin/pg_basebackup/pg_createsubscriber.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ cleanup_objects_atexit(void)
195195
*/
196196
if (dbinfo[i].made_publication)
197197
{
198-
pg_log_warning("publication \"%s\" in database \"%s\" on primary might be left behind",
198+
pg_log_warning("publication \"%s\" created in database \"%s\" on primary was left behind",
199199
dbinfo[i].pubname, dbinfo[i].dbname);
200-
pg_log_warning_hint("Consider dropping this publication before trying again.");
200+
pg_log_warning_hint("Drop this publication before trying again.");
201201
}
202202
if (dbinfo[i].made_replslot)
203203
{
204-
pg_log_warning("replication slot \"%s\" in database \"%s\" on primary might be left behind",
204+
pg_log_warning("replication slot \"%s\" created in database \"%s\" on primary was left behind",
205205
dbinfo[i].replslotname, dbinfo[i].dbname);
206206
pg_log_warning_hint("Drop this replication slot soon to avoid retention of WAL files.");
207207
}
@@ -221,14 +221,14 @@ usage(void)
221221
printf(_("Usage:\n"));
222222
printf(_(" %s [OPTION]...\n"), progname);
223223
printf(_("\nOptions:\n"));
224-
printf(_(" -d, --database=DBNAME database to create a subscription\n"));
224+
printf(_(" -d, --database=DBNAME database in which to create a subscription\n"));
225225
printf(_(" -D, --pgdata=DATADIR location for the subscriber data directory\n"));
226226
printf(_(" -n, --dry-run dry run, just show what would be done\n"));
227227
printf(_(" -p, --subscriber-port=PORT subscriber port number (default %s)\n"), DEFAULT_SUB_PORT);
228228
printf(_(" -P, --publisher-server=CONNSTR publisher connection string\n"));
229229
printf(_(" -s, --socketdir=DIR socket directory to use (default current dir.)\n"));
230230
printf(_(" -t, --recovery-timeout=SECS seconds to wait for recovery to end\n"));
231-
printf(_(" -U, --subscriber-username=NAME subscriber username\n"));
231+
printf(_(" -U, --subscriber-username=NAME user name for subscriber connection\n"));
232232
printf(_(" -v, --verbose output verbose messages\n"));
233233
printf(_(" --config-file=FILENAME use specified main server configuration\n"
234234
" file when running target cluster\n"));
@@ -670,7 +670,7 @@ modify_subscriber_sysid(const struct CreateSubscriberOptions *opt)
670670
if (rc == 0)
671671
pg_log_info("subscriber successfully changed the system identifier");
672672
else
673-
pg_fatal("subscriber failed to change system identifier: exit code: %d", rc);
673+
pg_fatal("could not change system identifier of subscriber: %s", wait_result_to_str(rc));
674674
}
675675

676676
pg_free(cf);
@@ -926,7 +926,7 @@ check_publisher(const struct LogicalRepInfo *dbinfo)
926926

927927
if (max_walsenders - cur_walsenders < num_dbs)
928928
{
929-
pg_log_error("publisher requires %d wal sender processes, but only %d remain",
929+
pg_log_error("publisher requires %d WAL sender processes, but only %d remain",
930930
num_dbs, max_walsenders - cur_walsenders);
931931
pg_log_error_hint("Increase the configuration parameter \"%s\" to at least %d.",
932932
"max_wal_senders", cur_walsenders + num_dbs);
@@ -935,7 +935,7 @@ check_publisher(const struct LogicalRepInfo *dbinfo)
935935

936936
if (max_prepared_transactions != 0)
937937
{
938-
pg_log_warning("two_phase option will not be enabled for slots");
938+
pg_log_warning("two_phase option will not be enabled for replication slots");
939939
pg_log_warning_detail("Subscriptions will be created with the two_phase option disabled. "
940940
"Prepared transactions will be replicated at COMMIT PREPARED.");
941941
}
@@ -1791,7 +1791,7 @@ set_replication_progress(PGconn *conn, const struct LogicalRepInfo *dbinfo, cons
17911791
*/
17921792
originname = psprintf("pg_%u", suboid);
17931793

1794-
pg_log_info("setting the replication progress (node name \"%s\" ; LSN %s) in database \"%s\"",
1794+
pg_log_info("setting the replication progress (node name \"%s\", LSN %s) in database \"%s\"",
17951795
originname, lsnstr, dbinfo->dbname);
17961796

17971797
resetPQExpBuffer(str);
@@ -1806,7 +1806,7 @@ set_replication_progress(PGconn *conn, const struct LogicalRepInfo *dbinfo, cons
18061806
res = PQexec(conn, str->data);
18071807
if (PQresultStatus(res) != PGRES_TUPLES_OK)
18081808
{
1809-
pg_log_error("could not set replication progress for the subscription \"%s\": %s",
1809+
pg_log_error("could not set replication progress for subscription \"%s\": %s",
18101810
dbinfo->subname, PQresultErrorMessage(res));
18111811
disconnect_database(conn, true);
18121812
}
@@ -1963,7 +1963,7 @@ main(int argc, char **argv)
19631963
}
19641964
else
19651965
{
1966-
pg_log_error("duplicate database \"%s\"", optarg);
1966+
pg_log_error("database \"%s\" specified more than once", optarg);
19671967
exit(1);
19681968
}
19691969
break;
@@ -2004,7 +2004,7 @@ main(int argc, char **argv)
20042004
}
20052005
else
20062006
{
2007-
pg_log_error("duplicate publication \"%s\"", optarg);
2007+
pg_log_error("publication \"%s\" specified more than once", optarg);
20082008
exit(1);
20092009
}
20102010
break;
@@ -2016,7 +2016,7 @@ main(int argc, char **argv)
20162016
}
20172017
else
20182018
{
2019-
pg_log_error("duplicate replication slot \"%s\"", optarg);
2019+
pg_log_error("replication slot \"%s\" specified more than once", optarg);
20202020
exit(1);
20212021
}
20222022
break;
@@ -2028,7 +2028,7 @@ main(int argc, char **argv)
20282028
}
20292029
else
20302030
{
2031-
pg_log_error("duplicate subscription \"%s\"", optarg);
2031+
pg_log_error("subscription \"%s\" specified more than once", optarg);
20322032
exit(1);
20332033
}
20342034
break;
@@ -2106,7 +2106,7 @@ main(int argc, char **argv)
21062106
simple_string_list_append(&opt.database_names, dbname_conninfo);
21072107
num_dbs++;
21082108

2109-
pg_log_info("database \"%s\" was extracted from the publisher connection string",
2109+
pg_log_info("database name \"%s\" was extracted from the publisher connection string",
21102110
dbname_conninfo);
21112111
}
21122112
else
@@ -2121,23 +2121,23 @@ main(int argc, char **argv)
21212121
/* Number of object names must match number of databases */
21222122
if (num_pubs > 0 && num_pubs != num_dbs)
21232123
{
2124-
pg_log_error("wrong number of publication names");
2125-
pg_log_error_hint("Number of publication names (%d) must match number of database names (%d).",
2126-
num_pubs, num_dbs);
2124+
pg_log_error("wrong number of publication names specified");
2125+
pg_log_error_detail("The number of specified publication names (%d) must match the number of specified database names (%d).",
2126+
num_pubs, num_dbs);
21272127
exit(1);
21282128
}
21292129
if (num_subs > 0 && num_subs != num_dbs)
21302130
{
2131-
pg_log_error("wrong number of subscription names");
2132-
pg_log_error_hint("Number of subscription names (%d) must match number of database names (%d).",
2133-
num_subs, num_dbs);
2131+
pg_log_error("wrong number of subscription names specified");
2132+
pg_log_error_detail("The number of specified subscription names (%d) must match the number of specified database names (%d).",
2133+
num_subs, num_dbs);
21342134
exit(1);
21352135
}
21362136
if (num_replslots > 0 && num_replslots != num_dbs)
21372137
{
2138-
pg_log_error("wrong number of replication slot names");
2139-
pg_log_error_hint("Number of replication slot names (%d) must match number of database names (%d).",
2140-
num_replslots, num_dbs);
2138+
pg_log_error("wrong number of replication slot names specified");
2139+
pg_log_error_detail("The number of specified replication slot names (%d) must match the number of specified database names (%d).",
2140+
num_replslots, num_dbs);
21412141
exit(1);
21422142
}
21432143

@@ -2178,8 +2178,8 @@ main(int argc, char **argv)
21782178
*/
21792179
if (stat(pidfile, &statbuf) == 0)
21802180
{
2181-
pg_log_error("standby is up and running");
2182-
pg_log_error_hint("Stop the standby and try again.");
2181+
pg_log_error("standby server is running");
2182+
pg_log_error_hint("Stop the standby server and try again.");
21832183
exit(1);
21842184
}
21852185

@@ -2188,7 +2188,7 @@ main(int argc, char **argv)
21882188
* by command-line options). The goal is to avoid connections during the
21892189
* transformation steps.
21902190
*/
2191-
pg_log_info("starting the standby with command-line options");
2191+
pg_log_info("starting the standby server with command-line options");
21922192
start_standby_server(&opt, true, false);
21932193

21942194
/* Check if the standby server is ready for logical replication */

0 commit comments

Comments
 (0)