Skip to content

Commit 3e0242b

Browse files
committed
Message fixes and style improvements
1 parent ac673a1 commit 3e0242b

File tree

24 files changed

+92
-89
lines changed

24 files changed

+92
-89
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,10 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params,
677677
read_rate, write_rate);
678678
appendStringInfo(&buf, _("system usage: %s\n"), pg_rusage_show(&ru0));
679679
appendStringInfo(&buf,
680-
_("WAL usage: %ld records, %ld full page images, "
681-
UINT64_FORMAT " bytes"),
680+
_("WAL usage: %ld records, %ld full page images, %llu bytes"),
682681
walusage.wal_records,
683682
walusage.wal_fpi,
684-
walusage.wal_bytes);
683+
(unsigned long long) walusage.wal_bytes);
685684

686685
ereport(LOG,
687686
(errmsg_internal("%s", buf.data)));
@@ -3523,9 +3522,10 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
35233522
false);
35243523
elevel = lvshared->elevel;
35253524

3526-
ereport(DEBUG1,
3527-
(errmsg("starting parallel vacuum worker for %s",
3528-
lvshared->for_cleanup ? "cleanup" : "bulk delete")));
3525+
if (lvshared->for_cleanup)
3526+
elog(DEBUG1, "starting parallel vacuum worker for cleanup");
3527+
else
3528+
elog(DEBUG1, "starting parallel vacuum worker for bulk delete");
35293529

35303530
/* Set debug_query_string for individual workers */
35313531
sharedquery = shm_toc_lookup(toc, PARALLEL_VACUUM_KEY_QUERY_TEXT, false);

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12504,7 +12504,7 @@ StartupRequestWalReceiverRestart(void)
1250412504
if (currentSource == XLOG_FROM_STREAM && WalRcvRunning())
1250512505
{
1250612506
ereport(LOG,
12507-
(errmsg("wal receiver process shutdown requested")));
12507+
(errmsg("WAL receiver process shutdown requested")));
1250812508

1250912509
pendingWalRcvRestart = true;
1251012510
}

src/backend/commands/opclasscmds.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,23 +1212,23 @@ assignProcTypes(OpFamilyMember *member, Oid amoid, Oid typeoid,
12121212
(OidIsValid(member->righttype) && member->righttype != typeoid))
12131213
ereport(ERROR,
12141214
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
1215-
errmsg("associated data types for opclass options parsing functions must match opclass input type")));
1215+
errmsg("associated data types for operator class options parsing functions must match opclass input type")));
12161216
}
12171217
else
12181218
{
12191219
if (member->lefttype != member->righttype)
12201220
ereport(ERROR,
12211221
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
1222-
errmsg("left and right associated data types for opclass options parsing functions must match")));
1222+
errmsg("left and right associated data types for operator class options parsing functions must match")));
12231223
}
12241224

12251225
if (procform->prorettype != VOIDOID ||
12261226
procform->pronargs != 1 ||
12271227
procform->proargtypes.values[0] != INTERNALOID)
12281228
ereport(ERROR,
12291229
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
1230-
errmsg("invalid opclass options parsing function"),
1231-
errhint("Valid signature of opclass options parsing function is '%s'.",
1230+
errmsg("invalid operator class options parsing function"),
1231+
errhint("Valid signature of operator class options parsing function is %s.",
12321232
"(internal) RETURNS void")));
12331233
}
12341234

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6855,7 +6855,7 @@ NotNullImpliedByRelConstraints(Relation rel, Form_pg_attribute attr)
68556855
if (ConstraintImpliedByRelConstraint(rel, list_make1(nnulltest), NIL))
68566856
{
68576857
ereport(DEBUG1,
6858-
(errmsg("existing constraints on column \"%s\".\"%s\" are sufficient to prove that it does not contain nulls",
6858+
(errmsg("existing constraints on column \"%s.%s\" are sufficient to prove that it does not contain nulls",
68596859
RelationGetRelationName(rel), NameStr(attr->attname))));
68606860
return true;
68616861
}

src/backend/libpq/hba.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,10 +1746,10 @@ parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline,
17461746
{
17471747
ereport(elevel,
17481748
(errcode(ERRCODE_CONFIG_FILE_ERROR),
1749-
errmsg("clientcert can not be set to \"no-verify\" when using \"cert\" authentication"),
1749+
errmsg("clientcert cannot be set to \"no-verify\" when using \"cert\" authentication"),
17501750
errcontext("line %d of configuration file \"%s\"",
17511751
line_num, HbaFileName)));
1752-
*err_msg = "clientcert can not be set to \"no-verify\" when using \"cert\" authentication";
1752+
*err_msg = "clientcert cannot be set to \"no-verify\" when using \"cert\" authentication";
17531753
return false;
17541754
}
17551755
hbaline->clientcert = clientCertOff;

src/backend/nodes/params.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,9 @@ ParamsErrorCallback(void *arg)
414414
return;
415415

416416
if (data->portalName && data->portalName[0] != '\0')
417-
errcontext("extended query \"%s\" with parameters: %s",
417+
errcontext("portal \"%s\" with parameters: %s",
418418
data->portalName, data->params->paramValuesStr);
419419
else
420-
errcontext("extended query with parameters: %s",
420+
errcontext("unnamed portal with parameters: %s",
421421
data->params->paramValuesStr);
422422
}

src/backend/parser/gram.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15919,7 +15919,7 @@ insertSelectOptions(SelectStmt *stmt,
1591915919
if (!stmt->sortClause && limitClause->limitOption == LIMIT_OPTION_WITH_TIES)
1592015920
ereport(ERROR,
1592115921
(errcode(ERRCODE_SYNTAX_ERROR),
15922-
errmsg("WITH TIES options can not be specified without ORDER BY clause")));
15922+
errmsg("WITH TIES cannot be specified without ORDER BY clause")));
1592315923
stmt->limitOption = limitClause->limitOption;
1592415924
}
1592515925
if (withClause)

src/backend/parser/parse_clause.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ transformLimitClause(ParseState *pstate, Node *clause,
17701770
IsA(clause, A_Const) && ((A_Const *) clause)->val.type == T_Null)
17711771
ereport(ERROR,
17721772
(errcode(ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE),
1773-
errmsg("row count cannot be NULL in FETCH FIRST ... WITH TIES clause")));
1773+
errmsg("row count cannot be null in FETCH FIRST ... WITH TIES clause")));
17741774

17751775
return qual;
17761776
}

src/backend/replication/basebackup.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,10 @@ perform_base_backup(basebackup_options *opt)
719719
{
720720
if (total_checksum_failures > 1)
721721
ereport(WARNING,
722-
(errmsg("%lld total checksum verification failures", total_checksum_failures)));
722+
(errmsg_plural("%lld total checksum verification failure",
723+
"%lld total checksum verification failures",
724+
total_checksum_failures,
725+
total_checksum_failures)));
723726

724727
ereport(ERROR,
725728
(errcode(ERRCODE_DATA_CORRUPTED),

src/backend/storage/ipc/procarray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3627,7 +3627,7 @@ TerminateOtherDBBackends(Oid databaseId)
36273627
if (nprepared > 0)
36283628
ereport(ERROR,
36293629
(errcode(ERRCODE_OBJECT_IN_USE),
3630-
errmsg("database \"%s\" is being used by prepared transaction",
3630+
errmsg("database \"%s\" is being used by prepared transactions",
36313631
get_database_name(databaseId)),
36323632
errdetail_plural("There is %d prepared transaction using the database.",
36333633
"There are %d prepared transactions using the database.",

src/backend/utils/adt/jsonpath_exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,9 +2582,9 @@ checkTimezoneIsUsedForCast(bool useTz, const char *type1, const char *type2)
25822582
if (!useTz)
25832583
ereport(ERROR,
25842584
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2585-
errmsg("cannot convert value from %s to %s without timezone usage",
2585+
errmsg("cannot convert value from %s to %s without time zone usage",
25862586
type1, type2),
2587-
errhint("Use *_tz() function for timezone support.")));
2587+
errhint("Use *_tz() function for time zone support.")));
25882588
}
25892589

25902590
/* Convert time datum to timetz datum */

src/backend/utils/fmgr/fmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ get_fn_opclass_options(FmgrInfo *flinfo)
20002000

20012001
ereport(ERROR,
20022002
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2003-
errmsg("opclass options info is absent in function call context")));
2003+
errmsg("operator class options info is absent in function call context")));
20042004

20052005
return NULL;
20062006
}

src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,7 +2837,7 @@ static struct config_int ConfigureNamesInt[] =
28372837
gettext_noop("Sets the minimum execution time above which "
28382838
"a sample of statements will be logged."
28392839
" Sampling is determined by log_statement_sample_rate."),
2840-
gettext_noop("Zero log a sample of all queries. -1 turns this feature off."),
2840+
gettext_noop("Zero logs a sample of all queries. -1 turns this feature off."),
28412841
GUC_UNIT_MS
28422842
},
28432843
&log_min_duration_sample,
@@ -3700,7 +3700,7 @@ static struct config_string ConfigureNamesString[] =
37003700

37013701
{
37023702
{"restore_command", PGC_POSTMASTER, WAL_ARCHIVE_RECOVERY,
3703-
gettext_noop("Sets the shell command that will retrieve an archived WAL file."),
3703+
gettext_noop("Sets the shell command that will be called to retrieve an archived WAL file."),
37043704
NULL
37053705
},
37063706
&recoveryRestoreCommand,

src/backend/utils/sort/sharedtuplestore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ sts_parallel_scan_next(SharedTuplestoreAccessor *accessor, void *meta_data)
566566
if (BufFileSeekBlock(accessor->read_file, read_page) != 0)
567567
ereport(ERROR,
568568
(errcode_for_file_access(),
569-
errmsg("could not seek block %u in shared tuplestore temporary file",
569+
errmsg("could not seek to block %u in shared tuplestore temporary file",
570570
read_page)));
571571
nread = BufFileRead(accessor->read_file, &chunk_header,
572572
STS_CHUNK_HEADER_SIZE);

src/bin/pg_verifybackup/parse_manifest.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ json_manifest_object_field_start(void *state, char *fname, bool isnull)
325325

326326
/* It's not a field we recognize. */
327327
json_manifest_parse_failure(parse->context,
328-
"unknown toplevel field");
328+
"unrecognized top-level field");
329329
break;
330330

331331
case JM_EXPECT_THIS_FILE_FIELD:
@@ -358,7 +358,7 @@ json_manifest_object_field_start(void *state, char *fname, bool isnull)
358358
parse->wal_range_field = JMWRF_END_LSN;
359359
else
360360
json_manifest_parse_failure(parse->context,
361-
"unexpected wal range field");
361+
"unexpected WAL range field");
362362
parse->state = JM_EXPECT_THIS_WAL_RANGE_VALUE;
363363
break;
364364

@@ -469,10 +469,10 @@ json_manifest_finalize_file(JsonManifestParseState *parse)
469469

470470
/* Pathname and size are required. */
471471
if (parse->pathname == NULL && parse->encoded_pathname == NULL)
472-
json_manifest_parse_failure(parse->context, "missing pathname");
472+
json_manifest_parse_failure(parse->context, "missing path name");
473473
if (parse->pathname != NULL && parse->encoded_pathname != NULL)
474474
json_manifest_parse_failure(parse->context,
475-
"both pathname and encoded pathname");
475+
"both path name and encoded path name");
476476
if (parse->size == NULL)
477477
json_manifest_parse_failure(parse->context, "missing size");
478478
if (parse->algorithm == NULL && parse->checksum != NULL)
@@ -491,7 +491,7 @@ json_manifest_finalize_file(JsonManifestParseState *parse)
491491
parse->encoded_pathname,
492492
raw_length))
493493
json_manifest_parse_failure(parse->context,
494-
"unable to decode filename");
494+
"could not decode file name");
495495
parse->pathname[raw_length] = '\0';
496496
pfree(parse->encoded_pathname);
497497
parse->encoded_pathname = NULL;
@@ -582,10 +582,10 @@ json_manifest_finalize_wal_range(JsonManifestParseState *parse)
582582
"timeline is not an integer");
583583
if (!parse_xlogrecptr(&start_lsn, parse->start_lsn))
584584
json_manifest_parse_failure(parse->context,
585-
"unable to parse start LSN");
585+
"could not parse start LSN");
586586
if (!parse_xlogrecptr(&end_lsn, parse->end_lsn))
587587
json_manifest_parse_failure(parse->context,
588-
"unable to parse end LSN");
588+
"could not parse end LSN");
589589

590590
/* Invoke the callback with the details we've gathered. */
591591
context->perwalrange_cb(context, tli, start_lsn, end_lsn);

src/bin/pg_verifybackup/pg_verifybackup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ record_manifest_details_for_file(JsonManifestParseContext *context,
471471
/* Make a new entry in the hash table for this file. */
472472
m = manifest_files_insert(ht, pathname, &found);
473473
if (found)
474-
report_fatal_error("duplicate pathname in backup manifest: \"%s\"",
474+
report_fatal_error("duplicate path name in backup manifest: \"%s\"",
475475
pathname);
476476

477477
/* Initialize the entry. */

src/bin/pg_verifybackup/t/005_bad_manifest.pl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@
3838
{"PostgreSQL-Backup-Manifest-Version": 1, "Files": true}
3939
EOM
4040

41-
test_parse_error('unknown toplevel field', <<EOM);
41+
test_parse_error('unrecognized top-level field', <<EOM);
4242
{"PostgreSQL-Backup-Manifest-Version": 1, "Oops": 1}
4343
EOM
4444

4545
test_parse_error('unexpected object start', <<EOM);
4646
{"PostgreSQL-Backup-Manifest-Version": 1, "Files": {}}
4747
EOM
4848

49-
test_parse_error('missing pathname', <<EOM);
49+
test_parse_error('missing path name', <<EOM);
5050
{"PostgreSQL-Backup-Manifest-Version": 1, "Files": [{}]}
5151
EOM
5252

53-
test_parse_error('both pathname and encoded pathname', <<EOM);
53+
test_parse_error('both path name and encoded path name', <<EOM);
5454
{"PostgreSQL-Backup-Manifest-Version": 1, "Files": [
5555
{"Path": "x", "Encoded-Path": "1234"}
5656
]}
@@ -74,13 +74,13 @@
7474
]}
7575
EOM
7676

77-
test_parse_error('unable to decode filename', <<EOM);
77+
test_parse_error('could not decode file name', <<EOM);
7878
{"PostgreSQL-Backup-Manifest-Version": 1, "Files": [
7979
{"Encoded-Path": "123", "Size": 0}
8080
]}
8181
EOM
8282

83-
test_fatal_error('duplicate pathname in backup manifest', <<EOM);
83+
test_fatal_error('duplicate path name in backup manifest', <<EOM);
8484
{"PostgreSQL-Backup-Manifest-Version": 1, "Files": [
8585
{"Path": "x", "Size": 0},
8686
{"Path": "x", "Size": 0}
@@ -117,7 +117,7 @@
117117
]}
118118
EOM
119119

120-
test_parse_error('unexpected wal range field', <<EOM);
120+
test_parse_error('unexpected WAL range field', <<EOM);
121121
{"PostgreSQL-Backup-Manifest-Version": 1, "WAL-Ranges": [
122122
{"Oops": 1}
123123
]}
@@ -141,13 +141,13 @@
141141
]}
142142
EOM
143143

144-
test_parse_error('unable to parse start LSN', <<EOM);
144+
test_parse_error('could not parse start LSN', <<EOM);
145145
{"PostgreSQL-Backup-Manifest-Version": 1, "WAL-Ranges": [
146146
{"Timeline": 1, "Start-LSN": "oops", "End-LSN": "0/0"}
147147
]}
148148
EOM
149149

150-
test_parse_error('unable to parse end LSN', <<EOM);
150+
test_parse_error('could not parse end LSN', <<EOM);
151151
{"PostgreSQL-Backup-Manifest-Version": 1, "WAL-Ranges": [
152152
{"Timeline": 1, "Start-LSN": "0/0", "End-LSN": "oops"}
153153
]}

src/bin/pgbench/t/001_pgbench_with_server.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ sub pgbench
287287
[],
288288
[
289289
qr{ERROR: invalid input syntax for type json},
290-
qr{(?!extended query with parameters)}
290+
qr{(?!unnamed portal with parameters)}
291291
],
292292
'server parameter logging',
293293
{
@@ -314,7 +314,7 @@ sub pgbench
314314
[],
315315
[
316316
qr{ERROR: division by zero},
317-
qr{CONTEXT: extended query with parameters: \$1 = '1', \$2 = NULL}
317+
qr{CONTEXT: unnamed portal with parameters: \$1 = '1', \$2 = NULL}
318318
],
319319
'server parameter logging',
320320
{
@@ -328,7 +328,7 @@ sub pgbench
328328
[],
329329
[
330330
qr{ERROR: invalid input syntax for type json},
331-
qr[CONTEXT: JSON data, line 1: \{ invalid\.\.\.[\r\n]+extended query with parameters: \$1 = '\{ invalid ', \$2 = '''Valame Dios!'' dijo Sancho; ''no le dije yo a vuestra merced que \.\.\.']m
331+
qr[CONTEXT: JSON data, line 1: \{ invalid\.\.\.[\r\n]+unnamed portal with parameters: \$1 = '\{ invalid ', \$2 = '''Valame Dios!'' dijo Sancho; ''no le dije yo a vuestra merced que \.\.\.']m
332332
],
333333
'server parameter logging',
334334
{
@@ -356,7 +356,7 @@ sub pgbench
356356
[],
357357
[
358358
qr{ERROR: division by zero},
359-
qr{CONTEXT: extended query with parameters: \$1 = '1', \$2 = NULL}
359+
qr{CONTEXT: unnamed portal with parameters: \$1 = '1', \$2 = NULL}
360360
],
361361
'server parameter logging',
362362
{
@@ -373,7 +373,7 @@ sub pgbench
373373
[],
374374
[
375375
qr{ERROR: invalid input syntax for type json},
376-
qr[CONTEXT: JSON data, line 1: \{ invalid\.\.\.[\r\n]+extended query with parameters: \$1 = '\{ invalid ', \$2 = '''Valame Dios!'' dijo Sancho; ''no le dije yo a vuestra merced que mirase bien lo que hacia\?']m
376+
qr[CONTEXT: JSON data, line 1: \{ invalid\.\.\.[\r\n]+unnamed portal with parameters: \$1 = '\{ invalid ', \$2 = '''Valame Dios!'' dijo Sancho; ''no le dije yo a vuestra merced que mirase bien lo que hacia\?']m
377377
],
378378
'server parameter logging',
379379
{

src/bin/scripts/vacuumdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ main(int argc, char *argv[])
305305
}
306306
if (vacopts.full)
307307
{
308-
pg_log_error("cannot use the \"%s\" option when performing full",
308+
pg_log_error("cannot use the \"%s\" option when performing full vacuum",
309309
"parallel");
310310
exit(1);
311311
}

src/fe_utils/archive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RestoreArchivedFile(const char *path, const char *xlogfname,
5050
xlogfname, NULL);
5151
if (xlogRestoreCmd == NULL)
5252
{
53-
pg_log_fatal("could not use restore_command with %%r alias");
53+
pg_log_fatal("cannot use restore_command with %%r placeholder");
5454
exit(1);
5555
}
5656

@@ -109,7 +109,7 @@ RestoreArchivedFile(const char *path, const char *xlogfname,
109109
*/
110110
if (wait_result_is_any_signal(rc, true))
111111
{
112-
pg_log_fatal("restore_command failed due to the signal: %s",
112+
pg_log_fatal("restore_command failed: %s",
113113
wait_result_to_str(rc));
114114
exit(1);
115115
}

0 commit comments

Comments
 (0)