Message fixes and style improvements

This commit is contained in:
Peter Eisentraut 2020-09-14 06:42:07 +02:00
parent b380484a85
commit b1b53f15bb
24 changed files with 92 additions and 89 deletions

@ -681,11 +681,10 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params,
read_rate, write_rate);
appendStringInfo(&buf, _("system usage: %s\n"), pg_rusage_show(&ru0));
appendStringInfo(&buf,
_("WAL usage: %ld records, %ld full page images, "
UINT64_FORMAT " bytes"),
_("WAL usage: %ld records, %ld full page images, %llu bytes"),
walusage.wal_records,
walusage.wal_fpi,
walusage.wal_bytes);
(unsigned long long) walusage.wal_bytes);
ereport(LOG,
(errmsg_internal("%s", buf.data)));
@ -3488,9 +3487,10 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
false);
elevel = lvshared->elevel;
ereport(DEBUG1,
(errmsg("starting parallel vacuum worker for %s",
lvshared->for_cleanup ? "cleanup" : "bulk delete")));
if (lvshared->for_cleanup)
elog(DEBUG1, "starting parallel vacuum worker for cleanup");
else
elog(DEBUG1, "starting parallel vacuum worker for bulk delete");
/* Set debug_query_string for individual workers */
sharedquery = shm_toc_lookup(toc, PARALLEL_VACUUM_KEY_QUERY_TEXT, false);

@ -12515,7 +12515,7 @@ StartupRequestWalReceiverRestart(void)
if (currentSource == XLOG_FROM_STREAM && WalRcvRunning())
{
ereport(LOG,
(errmsg("wal receiver process shutdown requested")));
(errmsg("WAL receiver process shutdown requested")));
pendingWalRcvRestart = true;
}

@ -1156,14 +1156,14 @@ assignProcTypes(OpFamilyMember *member, Oid amoid, Oid typeoid,
(OidIsValid(member->righttype) && member->righttype != typeoid))
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("associated data types for opclass options parsing functions must match opclass input type")));
errmsg("associated data types for operator class options parsing functions must match opclass input type")));
}
else
{
if (member->lefttype != member->righttype)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("left and right associated data types for opclass options parsing functions must match")));
errmsg("left and right associated data types for operator class options parsing functions must match")));
}
if (procform->prorettype != VOIDOID ||
@ -1171,8 +1171,8 @@ assignProcTypes(OpFamilyMember *member, Oid amoid, Oid typeoid,
procform->proargtypes.values[0] != INTERNALOID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("invalid opclass options parsing function"),
errhint("Valid signature of opclass options parsing function is '%s'.",
errmsg("invalid operator class options parsing function"),
errhint("Valid signature of operator class options parsing function is %s.",
"(internal) RETURNS void")));
}

@ -6853,7 +6853,7 @@ NotNullImpliedByRelConstraints(Relation rel, Form_pg_attribute attr)
if (ConstraintImpliedByRelConstraint(rel, list_make1(nnulltest), NIL))
{
ereport(DEBUG1,
(errmsg("existing constraints on column \"%s\".\"%s\" are sufficient to prove that it does not contain nulls",
(errmsg("existing constraints on column \"%s.%s\" are sufficient to prove that it does not contain nulls",
RelationGetRelationName(rel), NameStr(attr->attname))));
return true;
}

@ -356,9 +356,9 @@ ParamsErrorCallback(void *arg)
return;
if (data->portalName && data->portalName[0] != '\0')
errcontext("extended query \"%s\" with parameters: %s",
errcontext("portal \"%s\" with parameters: %s",
data->portalName, data->params->paramValuesStr);
else
errcontext("extended query with parameters: %s",
errcontext("unnamed portal with parameters: %s",
data->params->paramValuesStr);
}

@ -16161,7 +16161,7 @@ insertSelectOptions(SelectStmt *stmt,
if (!stmt->sortClause && limitClause->limitOption == LIMIT_OPTION_WITH_TIES)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("WITH TIES options can not be specified without ORDER BY clause")));
errmsg("WITH TIES cannot be specified without ORDER BY clause")));
stmt->limitOption = limitClause->limitOption;
}
if (withClause)

@ -1770,7 +1770,7 @@ transformLimitClause(ParseState *pstate, Node *clause,
IsA(clause, A_Const) && ((A_Const *) clause)->val.type == T_Null)
ereport(ERROR,
(errcode(ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE),
errmsg("row count cannot be NULL in FETCH FIRST ... WITH TIES clause")));
errmsg("row count cannot be null in FETCH FIRST ... WITH TIES clause")));
return qual;
}

@ -721,7 +721,10 @@ perform_base_backup(basebackup_options *opt)
{
if (total_checksum_failures > 1)
ereport(WARNING,
(errmsg("%lld total checksum verification failures", total_checksum_failures)));
(errmsg_plural("%lld total checksum verification failure",
"%lld total checksum verification failures",
total_checksum_failures,
total_checksum_failures)));
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),

@ -3011,7 +3011,7 @@ TerminateOtherDBBackends(Oid databaseId)
if (nprepared > 0)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_IN_USE),
errmsg("database \"%s\" is being used by prepared transaction",
errmsg("database \"%s\" is being used by prepared transactions",
get_database_name(databaseId)),
errdetail_plural("There is %d prepared transaction using the database.",
"There are %d prepared transactions using the database.",

@ -2000,7 +2000,7 @@ get_fn_opclass_options(FmgrInfo *flinfo)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("opclass options info is absent in function call context")));
errmsg("operator class options info is absent in function call context")));
return NULL;
}

@ -2830,7 +2830,7 @@ static struct config_int ConfigureNamesInt[] =
gettext_noop("Sets the minimum execution time above which "
"a sample of statements will be logged."
" Sampling is determined by log_statement_sample_rate."),
gettext_noop("Zero log a sample of all queries. -1 turns this feature off."),
gettext_noop("Zero logs a sample of all queries. -1 turns this feature off."),
GUC_UNIT_MS
},
&log_min_duration_sample,
@ -3682,7 +3682,7 @@ static struct config_string ConfigureNamesString[] =
{
{"restore_command", PGC_POSTMASTER, WAL_ARCHIVE_RECOVERY,
gettext_noop("Sets the shell command that will retrieve an archived WAL file."),
gettext_noop("Sets the shell command that will be called to retrieve an archived WAL file."),
NULL
},
&recoveryRestoreCommand,

@ -566,7 +566,7 @@ sts_parallel_scan_next(SharedTuplestoreAccessor *accessor, void *meta_data)
if (BufFileSeekBlock(accessor->read_file, read_page) != 0)
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not seek block %u in shared tuplestore temporary file",
errmsg("could not seek to block %u in shared tuplestore temporary file",
read_page)));
nread = BufFileRead(accessor->read_file, &chunk_header,
STS_CHUNK_HEADER_SIZE);

@ -325,7 +325,7 @@ json_manifest_object_field_start(void *state, char *fname, bool isnull)
/* It's not a field we recognize. */
json_manifest_parse_failure(parse->context,
"unknown toplevel field");
"unrecognized top-level field");
break;
case JM_EXPECT_THIS_FILE_FIELD:
@ -358,7 +358,7 @@ json_manifest_object_field_start(void *state, char *fname, bool isnull)
parse->wal_range_field = JMWRF_END_LSN;
else
json_manifest_parse_failure(parse->context,
"unexpected wal range field");
"unexpected WAL range field");
parse->state = JM_EXPECT_THIS_WAL_RANGE_VALUE;
break;
@ -491,7 +491,7 @@ json_manifest_finalize_file(JsonManifestParseState *parse)
parse->encoded_pathname,
raw_length))
json_manifest_parse_failure(parse->context,
"unable to decode filename");
"could not decode file name");
parse->pathname[raw_length] = '\0';
pfree(parse->encoded_pathname);
parse->encoded_pathname = NULL;
@ -582,10 +582,10 @@ json_manifest_finalize_wal_range(JsonManifestParseState *parse)
"timeline is not an integer");
if (!parse_xlogrecptr(&start_lsn, parse->start_lsn))
json_manifest_parse_failure(parse->context,
"unable to parse start LSN");
"could not parse start LSN");
if (!parse_xlogrecptr(&end_lsn, parse->end_lsn))
json_manifest_parse_failure(parse->context,
"unable to parse end LSN");
"could not parse end LSN");
/* Invoke the callback with the details we've gathered. */
context->perwalrange_cb(context, tli, start_lsn, end_lsn);

@ -38,7 +38,7 @@ test_parse_error('unexpected scalar', <<EOM);
{"PostgreSQL-Backup-Manifest-Version": 1, "Files": true}
EOM
test_parse_error('unknown toplevel field', <<EOM);
test_parse_error('unrecognized top-level field', <<EOM);
{"PostgreSQL-Backup-Manifest-Version": 1, "Oops": 1}
EOM
@ -74,7 +74,7 @@ test_parse_error('file size is not an integer', <<EOM);
]}
EOM
test_parse_error('unable to decode filename', <<EOM);
test_parse_error('could not decode file name', <<EOM);
{"PostgreSQL-Backup-Manifest-Version": 1, "Files": [
{"Encoded-Path": "123", "Size": 0}
]}
@ -117,7 +117,7 @@ test_parse_error('missing end LSN', <<EOM);
]}
EOM
test_parse_error('unexpected wal range field', <<EOM);
test_parse_error('unexpected WAL range field', <<EOM);
{"PostgreSQL-Backup-Manifest-Version": 1, "WAL-Ranges": [
{"Oops": 1}
]}
@ -141,13 +141,13 @@ test_parse_error('timeline is not an integer', <<EOM);
]}
EOM
test_parse_error('unable to parse start LSN', <<EOM);
test_parse_error('could not parse start LSN', <<EOM);
{"PostgreSQL-Backup-Manifest-Version": 1, "WAL-Ranges": [
{"Timeline": 1, "Start-LSN": "oops", "End-LSN": "0/0"}
]}
EOM
test_parse_error('unable to parse end LSN', <<EOM);
test_parse_error('could not parse end LSN', <<EOM);
{"PostgreSQL-Backup-Manifest-Version": 1, "WAL-Ranges": [
{"Timeline": 1, "Start-LSN": "0/0", "End-LSN": "oops"}
]}

@ -287,7 +287,7 @@ pgbench(
[],
[
qr{ERROR: invalid input syntax for type json},
qr{(?!extended query with parameters)}
qr{(?!unnamed portal with parameters)}
],
'server parameter logging',
{
@ -314,7 +314,7 @@ pgbench(
[],
[
qr{ERROR: division by zero},
qr{CONTEXT: extended query with parameters: \$1 = '1', \$2 = NULL}
qr{CONTEXT: unnamed portal with parameters: \$1 = '1', \$2 = NULL}
],
'server parameter logging',
{
@ -328,7 +328,7 @@ pgbench(
[],
[
qr{ERROR: invalid input syntax for type json},
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
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
],
'server parameter logging',
{
@ -356,7 +356,7 @@ pgbench(
[],
[
qr{ERROR: division by zero},
qr{CONTEXT: extended query with parameters: \$1 = '1', \$2 = NULL}
qr{CONTEXT: unnamed portal with parameters: \$1 = '1', \$2 = NULL}
],
'server parameter logging',
{
@ -373,7 +373,7 @@ pgbench(
[],
[
qr{ERROR: invalid input syntax for type json},
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
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
],
'server parameter logging',
{

@ -281,7 +281,7 @@ main(int argc, char *argv[])
}
if (vacopts.full)
{
pg_log_error("cannot use the \"%s\" option when performing full",
pg_log_error("cannot use the \"%s\" option when performing full vacuum",
"parallel");
exit(1);
}

@ -50,7 +50,7 @@ RestoreArchivedFile(const char *path, const char *xlogfname,
xlogfname, NULL);
if (xlogRestoreCmd == NULL)
{
pg_log_fatal("could not use restore_command with %%r alias");
pg_log_fatal("cannot use restore_command with %%r placeholder");
exit(1);
}
@ -109,7 +109,7 @@ RestoreArchivedFile(const char *path, const char *xlogfname,
*/
if (wait_result_is_any_signal(rc, true))
{
pg_log_fatal("restore_command failed due to the signal: %s",
pg_log_fatal("restore_command failed: %s",
wait_result_to_str(rc));
exit(1);
}

@ -56,7 +56,7 @@ run_sql_command(
$output = run_sql_command('alter table atacc1 alter test_a set not null;');
ok(!is_table_verified($output), 'with constraint will not scan table');
ok( $output =~
m/existing constraints on column "atacc1"."test_a" are sufficient to prove that it does not contain nulls/,
m/existing constraints on column "atacc1.test_a" are sufficient to prove that it does not contain nulls/,
'test_a proved by constraints');
run_sql_command('alter table atacc1 alter test_a drop not null;');
@ -68,7 +68,7 @@ $output = run_sql_command(
ok(is_table_verified($output), 'table was scanned');
# we may miss debug message for test_a constraint because we need verify table due test_b
ok( !( $output =~
m/existing constraints on column "atacc1"."test_b" are sufficient to prove that it does not contain nulls/
m/existing constraints on column "atacc1.test_b" are sufficient to prove that it does not contain nulls/
),
'test_b not proved by wrong constraints');
run_sql_command(
@ -84,10 +84,10 @@ $output = run_sql_command(
);
ok(!is_table_verified($output), 'table was not scanned for both columns');
ok( $output =~
m/existing constraints on column "atacc1"."test_a" are sufficient to prove that it does not contain nulls/,
m/existing constraints on column "atacc1.test_a" are sufficient to prove that it does not contain nulls/,
'test_a proved by constraints');
ok( $output =~
m/existing constraints on column "atacc1"."test_b" are sufficient to prove that it does not contain nulls/,
m/existing constraints on column "atacc1.test_b" are sufficient to prove that it does not contain nulls/,
'test_b proved by constraints');
run_sql_command('drop table atacc1;');

@ -505,10 +505,10 @@ CREATE OPERATOR FAMILY alt_opf19 USING btree;
ALTER OPERATOR FAMILY alt_opf19 USING btree ADD FUNCTION 5 test_opclass_options_func(internal, text[], bool);
ERROR: function test_opclass_options_func(internal, text[], boolean) does not exist
ALTER OPERATOR FAMILY alt_opf19 USING btree ADD FUNCTION 5 (int4) btint42cmp(int4, int2);
ERROR: invalid opclass options parsing function
HINT: Valid signature of opclass options parsing function is '(internal) RETURNS void'.
ERROR: invalid operator class options parsing function
HINT: Valid signature of operator class options parsing function is (internal) RETURNS void.
ALTER OPERATOR FAMILY alt_opf19 USING btree ADD FUNCTION 5 (int4, int2) btint42cmp(int4, int2);
ERROR: left and right associated data types for opclass options parsing functions must match
ERROR: left and right associated data types for operator class options parsing functions must match
ALTER OPERATOR FAMILY alt_opf19 USING btree ADD FUNCTION 5 (int4) test_opclass_options_func(internal); -- Ok
ALTER OPERATOR FAMILY alt_opf19 USING btree DROP FUNCTION 5 (int4, int4);
DROP OPERATOR FAMILY alt_opf19 USING btree;

@ -623,7 +623,7 @@ SELECT thousand
SELECT ''::text AS two, unique1, unique2, stringu1
FROM onek WHERE unique1 > 50
FETCH FIRST 2 ROW WITH TIES;
ERROR: WITH TIES options can not be specified without ORDER BY clause
ERROR: WITH TIES cannot be specified without ORDER BY clause
-- test ruleutils
CREATE VIEW limit_thousand_v_1 AS SELECT thousand FROM onek WHERE thousand < 995
ORDER BY thousand FETCH FIRST 5 ROWS WITH TIES OFFSET 10;
@ -657,7 +657,7 @@ View definition:
CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
ORDER BY thousand FETCH FIRST NULL ROWS WITH TIES; -- fails
ERROR: row count cannot be NULL in FETCH FIRST ... WITH TIES clause
ERROR: row count cannot be null in FETCH FIRST ... WITH TIES clause
CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
ORDER BY thousand FETCH FIRST (NULL+1) ROWS WITH TIES;
\d+ limit_thousand_v_3