Skip to content

Commit 5a73a9e

Browse files
committed
pg_amcheck: Message style and formatting improvements
1 parent fc69509 commit 5a73a9e

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

src/bin/pg_amcheck/pg_amcheck.c

+45-45
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ main(int argc, char *argv[])
402402
opts.skip = "all frozen";
403403
else
404404
{
405-
pg_log_error("invalid skip option");
405+
pg_log_error("invalid argument for option %s", "--skip");
406406
exit(1);
407407
}
408408
break;
@@ -1114,7 +1114,7 @@ verify_btree_slot_handler(PGresult *res, PGconn *conn, void *context)
11141114
rel->datinfo->datname, rel->nspname, rel->relname, ntups);
11151115
if (opts.verbose)
11161116
pg_log_info("query was: %s", rel->sql);
1117-
pg_log_warning("are %s's and amcheck's versions compatible?",
1117+
pg_log_warning("Are %s's and amcheck's versions compatible?",
11181118
progname);
11191119
progress_since_last_stderr = false;
11201120
}
@@ -1148,50 +1148,50 @@ verify_btree_slot_handler(PGresult *res, PGconn *conn, void *context)
11481148
static void
11491149
help(const char *progname)
11501150
{
1151-
printf(_("%s uses amcheck module to check objects in a PostgreSQL database for corruption.\n\n"), progname);
1151+
printf(_("%s checks objects in a PostgreSQL database for corruption.\n\n"), progname);
11521152
printf(_("Usage:\n"));
11531153
printf(_(" %s [OPTION]... [DBNAME]\n"), progname);
1154-
printf(_("\nTarget Options:\n"));
1155-
printf(_(" -a, --all check all databases\n"));
1156-
printf(_(" -d, --database=PATTERN check matching database(s)\n"));
1157-
printf(_(" -D, --exclude-database=PATTERN do NOT check matching database(s)\n"));
1158-
printf(_(" -i, --index=PATTERN check matching index(es)\n"));
1159-
printf(_(" -I, --exclude-index=PATTERN do NOT check matching index(es)\n"));
1160-
printf(_(" -r, --relation=PATTERN check matching relation(s)\n"));
1161-
printf(_(" -R, --exclude-relation=PATTERN do NOT check matching relation(s)\n"));
1162-
printf(_(" -s, --schema=PATTERN check matching schema(s)\n"));
1163-
printf(_(" -S, --exclude-schema=PATTERN do NOT check matching schema(s)\n"));
1164-
printf(_(" -t, --table=PATTERN check matching table(s)\n"));
1165-
printf(_(" -T, --exclude-table=PATTERN do NOT check matching table(s)\n"));
1166-
printf(_(" --no-dependent-indexes do NOT expand list of relations to include indexes\n"));
1167-
printf(_(" --no-dependent-toast do NOT expand list of relations to include toast\n"));
1168-
printf(_(" --no-strict-names do NOT require patterns to match objects\n"));
1169-
printf(_("\nTable Checking Options:\n"));
1170-
printf(_(" --exclude-toast-pointers do NOT follow relation toast pointers\n"));
1171-
printf(_(" --on-error-stop stop checking at end of first corrupt page\n"));
1172-
printf(_(" --skip=OPTION do NOT check \"all-frozen\" or \"all-visible\" blocks\n"));
1173-
printf(_(" --startblock=BLOCK begin checking table(s) at the given block number\n"));
1174-
printf(_(" --endblock=BLOCK check table(s) only up to the given block number\n"));
1175-
printf(_("\nBtree Index Checking Options:\n"));
1176-
printf(_(" --heapallindexed check all heap tuples are found within indexes\n"));
1177-
printf(_(" --parent-check check index parent/child relationships\n"));
1178-
printf(_(" --rootdescend search from root page to refind tuples\n"));
1154+
printf(_("\nTarget options:\n"));
1155+
printf(_(" -a, --all check all databases\n"));
1156+
printf(_(" -d, --database=PATTERN check matching database(s)\n"));
1157+
printf(_(" -D, --exclude-database=PATTERN do NOT check matching database(s)\n"));
1158+
printf(_(" -i, --index=PATTERN check matching index(es)\n"));
1159+
printf(_(" -I, --exclude-index=PATTERN do NOT check matching index(es)\n"));
1160+
printf(_(" -r, --relation=PATTERN check matching relation(s)\n"));
1161+
printf(_(" -R, --exclude-relation=PATTERN do NOT check matching relation(s)\n"));
1162+
printf(_(" -s, --schema=PATTERN check matching schema(s)\n"));
1163+
printf(_(" -S, --exclude-schema=PATTERN do NOT check matching schema(s)\n"));
1164+
printf(_(" -t, --table=PATTERN check matching table(s)\n"));
1165+
printf(_(" -T, --exclude-table=PATTERN do NOT check matching table(s)\n"));
1166+
printf(_(" --no-dependent-indexes do NOT expand list of relations to include indexes\n"));
1167+
printf(_(" --no-dependent-toast do NOT expand list of relations to include TOAST tables\n"));
1168+
printf(_(" --no-strict-names do NOT require patterns to match objects\n"));
1169+
printf(_("\nTable checking options:\n"));
1170+
printf(_(" --exclude-toast-pointers do NOT follow relation TOAST pointers\n"));
1171+
printf(_(" --on-error-stop stop checking at end of first corrupt page\n"));
1172+
printf(_(" --skip=OPTION do NOT check \"all-frozen\" or \"all-visible\" blocks\n"));
1173+
printf(_(" --startblock=BLOCK begin checking table(s) at the given block number\n"));
1174+
printf(_(" --endblock=BLOCK check table(s) only up to the given block number\n"));
1175+
printf(_("\nB-tree index checking options:\n"));
1176+
printf(_(" --heapallindexed check all heap tuples are found within indexes\n"));
1177+
printf(_(" --parent-check check index parent/child relationships\n"));
1178+
printf(_(" --rootdescend search from root page to refind tuples\n"));
11791179
printf(_("\nConnection options:\n"));
1180-
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
1181-
printf(_(" -p, --port=PORT database server port\n"));
1182-
printf(_(" -U, --username=USERNAME user name to connect as\n"));
1183-
printf(_(" -w, --no-password never prompt for password\n"));
1184-
printf(_(" -W, --password force password prompt\n"));
1185-
printf(_(" --maintenance-db=DBNAME alternate maintenance database\n"));
1186-
printf(_("\nOther Options:\n"));
1187-
printf(_(" -e, --echo show the commands being sent to the server\n"));
1188-
printf(_(" -j, --jobs=NUM use this many concurrent connections to the server\n"));
1189-
printf(_(" -q, --quiet don't write any messages\n"));
1190-
printf(_(" -v, --verbose write a lot of output\n"));
1191-
printf(_(" -V, --version output version information, then exit\n"));
1192-
printf(_(" -P, --progress show progress information\n"));
1193-
printf(_(" -?, --help show this help, then exit\n"));
1194-
printf(_(" --install-missing install missing extensions\n"));
1180+
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
1181+
printf(_(" -p, --port=PORT database server port\n"));
1182+
printf(_(" -U, --username=USERNAME user name to connect as\n"));
1183+
printf(_(" -w, --no-password never prompt for password\n"));
1184+
printf(_(" -W, --password force password prompt\n"));
1185+
printf(_(" --maintenance-db=DBNAME alternate maintenance database\n"));
1186+
printf(_("\nOther options:\n"));
1187+
printf(_(" -e, --echo show the commands being sent to the server\n"));
1188+
printf(_(" -j, --jobs=NUM use this many concurrent connections to the server\n"));
1189+
printf(_(" -q, --quiet don't write any messages\n"));
1190+
printf(_(" -v, --verbose write a lot of output\n"));
1191+
printf(_(" -V, --version output version information, then exit\n"));
1192+
printf(_(" -P, --progress show progress information\n"));
1193+
printf(_(" -?, --help show this help, then exit\n"));
1194+
printf(_(" --install-missing install missing extensions\n"));
11951195

11961196
printf(_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
11971197
printf(_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
@@ -1547,7 +1547,7 @@ compile_database_list(PGconn *conn, SimplePtrList *databases,
15471547

15481548
/* This database is included. Add to list */
15491549
if (opts.verbose)
1550-
pg_log_info("including database: \"%s\"", initial_dbname);
1550+
pg_log_info("including database \"%s\"", initial_dbname);
15511551

15521552
dat->datname = pstrdup(initial_dbname);
15531553
simple_ptr_list_append(databases, dat);
@@ -1689,7 +1689,7 @@ compile_database_list(PGconn *conn, SimplePtrList *databases,
16891689

16901690
/* This database is included. Add to list */
16911691
if (opts.verbose)
1692-
pg_log_info("including database: \"%s\"", datname);
1692+
pg_log_info("including database \"%s\"", datname);
16931693

16941694
dat = (DatabaseInfo *) pg_malloc0(sizeof(DatabaseInfo));
16951695
dat->datname = pstrdup(datname);

0 commit comments

Comments
 (0)