mirror of
https://github.com/postgres/postgres.git
synced 2025-05-21 00:02:53 -04:00
Assorted translatable string fixes
Mark our rusage reportage string translatable; remove quotes from type names; unify formatting of very similar messages.
This commit is contained in:
parent
5936d25f81
commit
55a70a023c
@ -73,10 +73,8 @@ brin_doupdate(Relation idxrel, BlockNumber pagesPerRange,
|
||||
{
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
||||
errmsg("index row size %lu exceeds maximum %lu for index \"%s\"",
|
||||
(unsigned long) newsz,
|
||||
(unsigned long) BrinMaxItemSize,
|
||||
RelationGetRelationName(idxrel))));
|
||||
errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
|
||||
newsz, BrinMaxItemSize, RelationGetRelationName(idxrel))));
|
||||
return false; /* keep compiler quiet */
|
||||
}
|
||||
|
||||
@ -357,10 +355,8 @@ brin_doinsert(Relation idxrel, BlockNumber pagesPerRange,
|
||||
{
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
||||
errmsg("index row size %lu exceeds maximum %lu for index \"%s\"",
|
||||
(unsigned long) itemsz,
|
||||
(unsigned long) BrinMaxItemSize,
|
||||
RelationGetRelationName(idxrel))));
|
||||
errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
|
||||
itemsz, BrinMaxItemSize, RelationGetRelationName(idxrel))));
|
||||
return InvalidOffsetNumber; /* keep compiler quiet */
|
||||
}
|
||||
|
||||
@ -669,7 +665,7 @@ brin_getinsertbuffer(Relation irel, Buffer oldbuf, Size itemsz,
|
||||
BlockNumber oldblk;
|
||||
BlockNumber newblk;
|
||||
Page page;
|
||||
int freespace;
|
||||
Size freespace;
|
||||
|
||||
/* callers must have checked */
|
||||
Assert(itemsz <= BrinMaxItemSize);
|
||||
@ -825,10 +821,8 @@ brin_getinsertbuffer(Relation irel, Buffer oldbuf, Size itemsz,
|
||||
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
||||
errmsg("index row size %lu exceeds maximum %lu for index \"%s\"",
|
||||
(unsigned long) itemsz,
|
||||
(unsigned long) freespace,
|
||||
RelationGetRelationName(irel))));
|
||||
errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
|
||||
itemsz, freespace, RelationGetRelationName(irel))));
|
||||
return InvalidBuffer; /* keep compiler quiet */
|
||||
}
|
||||
|
||||
|
@ -3462,7 +3462,7 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
|
||||
ereport(INFO,
|
||||
(errmsg("index \"%s\" was reindexed",
|
||||
get_rel_name(indexId)),
|
||||
errdetail("%s.",
|
||||
errdetail_internal("%s",
|
||||
pg_rusage_show(&ru0))));
|
||||
|
||||
/* Close rels, but keep locks */
|
||||
|
@ -3793,7 +3793,7 @@ InitTempTableNamespace(void)
|
||||
if (IsParallelWorker())
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
|
||||
errmsg("cannot create temporary tables in parallel mode")));
|
||||
errmsg("cannot create temporary tables during a parallel operation")));
|
||||
|
||||
snprintf(namespaceName, sizeof(namespaceName), "pg_temp_%d", MyBackendId);
|
||||
|
||||
|
@ -1353,8 +1353,7 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats,
|
||||
"%u pages are entirely empty.\n",
|
||||
empty_pages),
|
||||
empty_pages);
|
||||
appendStringInfo(&buf, _("%s."),
|
||||
pg_rusage_show(&ru0));
|
||||
appendStringInfo(&buf, "%s.", pg_rusage_show(&ru0));
|
||||
|
||||
ereport(elevel,
|
||||
(errmsg("\"%s\": found %.0f removable, %.0f nonremovable row versions in %u out of %u pages",
|
||||
@ -1429,8 +1428,7 @@ lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats)
|
||||
(errmsg("\"%s\": removed %d row versions in %d pages",
|
||||
RelationGetRelationName(onerel),
|
||||
tupindex, npages),
|
||||
errdetail("%s.",
|
||||
pg_rusage_show(&ru0))));
|
||||
errdetail_internal("%s", pg_rusage_show(&ru0))));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1618,7 +1616,7 @@ lazy_vacuum_index(Relation indrel,
|
||||
(errmsg("scanned index \"%s\" to remove %d row versions",
|
||||
RelationGetRelationName(indrel),
|
||||
vacrelstats->num_dead_tuples),
|
||||
errdetail("%s.", pg_rusage_show(&ru0))));
|
||||
errdetail_internal("%s", pg_rusage_show(&ru0))));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1828,7 +1826,7 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats)
|
||||
(errmsg("\"%s\": truncated %u to %u pages",
|
||||
RelationGetRelationName(onerel),
|
||||
old_rel_pages, new_rel_pages),
|
||||
errdetail("%s.",
|
||||
errdetail_internal("%s",
|
||||
pg_rusage_show(&ru0))));
|
||||
old_rel_pages = new_rel_pages;
|
||||
} while (new_rel_pages > vacrelstats->nonempty_pages &&
|
||||
|
@ -773,7 +773,7 @@ assign_client_encoding(const char *newval, void *extra)
|
||||
*/
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TRANSACTION_STATE),
|
||||
errmsg("cannot change client_encoding in a parallel worker")));
|
||||
errmsg("cannot change client_encoding during a parallel operation")));
|
||||
}
|
||||
|
||||
/* We do not expect an error if PrepareClientEncoding succeeded */
|
||||
|
@ -902,7 +902,7 @@ PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems)
|
||||
offset != MAXALIGN(offset))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATA_CORRUPTED),
|
||||
errmsg("corrupted item pointer: offset = %u, size = %u",
|
||||
errmsg("corrupted item pointer: offset = %u, length = %u",
|
||||
offset, (unsigned int) size)));
|
||||
|
||||
if (nextitm < nitems && offnum == itemnos[nextitm])
|
||||
|
@ -2008,7 +2008,7 @@ json_object_agg_transfn(PG_FUNCTION_ARGS)
|
||||
if (arg_type == InvalidOid)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("could not determine data type for argument 1")));
|
||||
errmsg("could not determine data type for argument %d", 1)));
|
||||
|
||||
json_categorize_type(arg_type, &state->key_category,
|
||||
&state->key_output_func);
|
||||
@ -2018,7 +2018,7 @@ json_object_agg_transfn(PG_FUNCTION_ARGS)
|
||||
if (arg_type == InvalidOid)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("could not determine data type for argument 2")));
|
||||
errmsg("could not determine data type for argument %d", 2)));
|
||||
|
||||
json_categorize_type(arg_type, &state->val_category,
|
||||
&state->val_output_func);
|
||||
|
@ -1212,7 +1212,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
|
||||
if (val_type == InvalidOid || val_type == UNKNOWNOID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("argument %d: could not determine data type", i + 1)));
|
||||
errmsg("could not determine data type for argument %d", i + 1)));
|
||||
|
||||
add_jsonb(arg, false, &result, val_type, true);
|
||||
|
||||
@ -1235,7 +1235,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
|
||||
if (val_type == InvalidOid || val_type == UNKNOWNOID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("argument %d: could not determine data type", i + 2)));
|
||||
errmsg("could not determine data type for argument %d", i + 2)));
|
||||
add_jsonb(arg, PG_ARGISNULL(i + 1), &result, val_type, false);
|
||||
}
|
||||
|
||||
@ -1295,7 +1295,7 @@ jsonb_build_array(PG_FUNCTION_ARGS)
|
||||
if (val_type == InvalidOid || val_type == UNKNOWNOID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("argument %d: could not determine data type", i + 1)));
|
||||
errmsg("could not determine data type for argument %d", i + 1)));
|
||||
add_jsonb(arg, PG_ARGISNULL(i), &result, val_type, false);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ pg_rusage_show(const PGRUsage *ru0)
|
||||
}
|
||||
|
||||
snprintf(result, sizeof(result),
|
||||
"CPU: user: %d.%02d s, system: %d.%02d s, elapsed: %d.%02d s",
|
||||
_("CPU: user: %d.%02d s, system: %d.%02d s, elapsed: %d.%02d s"),
|
||||
(int) (ru1.ru.ru_utime.tv_sec - ru0->ru.ru_utime.tv_sec),
|
||||
(int) (ru1.ru.ru_utime.tv_usec - ru0->ru.ru_utime.tv_usec) / 10000,
|
||||
(int) (ru1.ru.ru_stime.tv_sec - ru0->ru.ru_stime.tv_sec),
|
||||
|
Loading…
x
Reference in New Issue
Block a user