Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita68159f

Browse files
committed
Unify some error messages to ease work of translators
This commit updates a couple of error messages around control file data,GUCs and server settings, unifying to the same message where possible.This reduces the translation burden a bit.Author: Peter SmithDiscussion:https://postgr.es/m/CAHut+Pv-kSN8SkxSdoHano_wPubqcg5789ejhCDZAcLFceBR-w@mail.gmail.com
1 parentb4db642 commita68159f

File tree

4 files changed

+73
-42
lines changed

4 files changed

+73
-42
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4395,17 +4395,21 @@ ReadControlFile(void)
43954395
ereport(FATAL,
43964396
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
43974397
errmsg("database files are incompatible with server"),
4398-
errdetail("The database cluster was initialized with CATALOG_VERSION_NO %d,"
4399-
" but the server was compiled with CATALOG_VERSION_NO %d.",
4400-
ControlFile->catalog_version_no,CATALOG_VERSION_NO),
4398+
/* translator: %s is a variable name and %d is its value */
4399+
errdetail("The database cluster was initialized with %s %d,"
4400+
" but the server was compiled with %s %d.",
4401+
"CATALOG_VERSION_NO",ControlFile->catalog_version_no,
4402+
"CATALOG_VERSION_NO",CATALOG_VERSION_NO),
44014403
errhint("It looks like you need to initdb.")));
44024404
if (ControlFile->maxAlign!=MAXIMUM_ALIGNOF)
44034405
ereport(FATAL,
44044406
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
44054407
errmsg("database files are incompatible with server"),
4406-
errdetail("The database cluster was initialized with MAXALIGN %d,"
4407-
" but the server was compiled with MAXALIGN %d.",
4408-
ControlFile->maxAlign,MAXIMUM_ALIGNOF),
4408+
/* translator: %s is a variable name and %d is its value */
4409+
errdetail("The database cluster was initialized with %s %d,"
4410+
" but the server was compiled with %s %d.",
4411+
"MAXALIGN",ControlFile->maxAlign,
4412+
"MAXALIGN",MAXIMUM_ALIGNOF),
44094413
errhint("It looks like you need to initdb.")));
44104414
if (ControlFile->floatFormat!=FLOATFORMAT_VALUE)
44114415
ereport(FATAL,
@@ -4417,57 +4421,71 @@ ReadControlFile(void)
44174421
ereport(FATAL,
44184422
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
44194423
errmsg("database files are incompatible with server"),
4420-
errdetail("The database cluster was initialized with BLCKSZ %d,"
4421-
" but the server was compiled with BLCKSZ %d.",
4422-
ControlFile->blcksz,BLCKSZ),
4424+
/* translator: %s is a variable name and %d is its value */
4425+
errdetail("The database cluster was initialized with %s %d,"
4426+
" but the server was compiled with %s %d.",
4427+
"BLCKSZ",ControlFile->blcksz,
4428+
"BLCKSZ",BLCKSZ),
44234429
errhint("It looks like you need to recompile or initdb.")));
44244430
if (ControlFile->relseg_size!=RELSEG_SIZE)
44254431
ereport(FATAL,
44264432
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
44274433
errmsg("database files are incompatible with server"),
4428-
errdetail("The database cluster was initialized with RELSEG_SIZE %d,"
4429-
" but the server was compiled with RELSEG_SIZE %d.",
4430-
ControlFile->relseg_size,RELSEG_SIZE),
4434+
/* translator: %s is a variable name and %d is its value */
4435+
errdetail("The database cluster was initialized with %s %d,"
4436+
" but the server was compiled with %s %d.",
4437+
"RELSEG_SIZE",ControlFile->relseg_size,
4438+
"RELSEG_SIZE",RELSEG_SIZE),
44314439
errhint("It looks like you need to recompile or initdb.")));
44324440
if (ControlFile->xlog_blcksz!=XLOG_BLCKSZ)
44334441
ereport(FATAL,
44344442
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
44354443
errmsg("database files are incompatible with server"),
4436-
errdetail("The database cluster was initialized with XLOG_BLCKSZ %d,"
4437-
" but the server was compiled with XLOG_BLCKSZ %d.",
4438-
ControlFile->xlog_blcksz,XLOG_BLCKSZ),
4444+
/* translator: %s is a variable name and %d is its value */
4445+
errdetail("The database cluster was initialized with %s %d,"
4446+
" but the server was compiled with %s %d.",
4447+
"XLOG_BLCKSZ",ControlFile->xlog_blcksz,
4448+
"XLOG_BLCKSZ",XLOG_BLCKSZ),
44394449
errhint("It looks like you need to recompile or initdb.")));
44404450
if (ControlFile->nameDataLen!=NAMEDATALEN)
44414451
ereport(FATAL,
44424452
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
44434453
errmsg("database files are incompatible with server"),
4444-
errdetail("The database cluster was initialized with NAMEDATALEN %d,"
4445-
" but the server was compiled with NAMEDATALEN %d.",
4446-
ControlFile->nameDataLen,NAMEDATALEN),
4454+
/* translator: %s is a variable name and %d is its value */
4455+
errdetail("The database cluster was initialized with %s %d,"
4456+
" but the server was compiled with %s %d.",
4457+
"NAMEDATALEN",ControlFile->nameDataLen,
4458+
"NAMEDATALEN",NAMEDATALEN),
44474459
errhint("It looks like you need to recompile or initdb.")));
44484460
if (ControlFile->indexMaxKeys!=INDEX_MAX_KEYS)
44494461
ereport(FATAL,
44504462
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
44514463
errmsg("database files are incompatible with server"),
4452-
errdetail("The database cluster was initialized with INDEX_MAX_KEYS %d,"
4453-
" but the server was compiled with INDEX_MAX_KEYS %d.",
4454-
ControlFile->indexMaxKeys,INDEX_MAX_KEYS),
4464+
/* translator: %s is a variable name and %d is its value */
4465+
errdetail("The database cluster was initialized with %s %d,"
4466+
" but the server was compiled with %s %d.",
4467+
"INDEX_MAX_KEYS",ControlFile->indexMaxKeys,
4468+
"INDEX_MAX_KEYS",INDEX_MAX_KEYS),
44554469
errhint("It looks like you need to recompile or initdb.")));
44564470
if (ControlFile->toast_max_chunk_size!=TOAST_MAX_CHUNK_SIZE)
44574471
ereport(FATAL,
44584472
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
44594473
errmsg("database files are incompatible with server"),
4460-
errdetail("The database cluster was initialized with TOAST_MAX_CHUNK_SIZE %d,"
4461-
" but the server was compiled with TOAST_MAX_CHUNK_SIZE %d.",
4462-
ControlFile->toast_max_chunk_size, (int)TOAST_MAX_CHUNK_SIZE),
4474+
/* translator: %s is a variable name and %d is its value */
4475+
errdetail("The database cluster was initialized with %s %d,"
4476+
" but the server was compiled with %s %d.",
4477+
"TOAST_MAX_CHUNK_SIZE",ControlFile->toast_max_chunk_size,
4478+
"TOAST_MAX_CHUNK_SIZE", (int)TOAST_MAX_CHUNK_SIZE),
44634479
errhint("It looks like you need to recompile or initdb.")));
44644480
if (ControlFile->loblksize!=LOBLKSIZE)
44654481
ereport(FATAL,
44664482
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
44674483
errmsg("database files are incompatible with server"),
4468-
errdetail("The database cluster was initialized with LOBLKSIZE %d,"
4469-
" but the server was compiled with LOBLKSIZE %d.",
4470-
ControlFile->loblksize, (int)LOBLKSIZE),
4484+
/* translator: %s is a variable name and %d is its value */
4485+
errdetail("The database cluster was initialized with %s %d,"
4486+
" but the server was compiled with %s %d.",
4487+
"LOBLKSIZE",ControlFile->loblksize,
4488+
"LOBLKSIZE", (int)LOBLKSIZE),
44714489
errhint("It looks like you need to recompile or initdb.")));
44724490

44734491
#ifdefUSE_FLOAT8_BYVAL
@@ -4505,11 +4523,15 @@ ReadControlFile(void)
45054523
/* check and update variables dependent on wal_segment_size */
45064524
if (ConvertToXSegs(min_wal_size_mb,wal_segment_size)<2)
45074525
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4508-
errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\"")));
4526+
/* translator: both %s are GUC names */
4527+
errmsg("\"%s\" must be at least twice \"%s\"",
4528+
"min_wal_size","wal_segment_size")));
45094529

45104530
if (ConvertToXSegs(max_wal_size_mb,wal_segment_size)<2)
45114531
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4512-
errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\"")));
4532+
/* translator: both %s are GUC names */
4533+
errmsg("\"%s\" must be at least twice \"%s\"",
4534+
"max_wal_size","wal_segment_size")));
45134535

45144536
UsableBytesInSegment=
45154537
(wal_segment_size /XLOG_BLCKSZ*UsableBytesInPage)-

‎src/backend/commands/variable.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,8 @@ check_effective_io_concurrency(int *newval, void **extra, GucSource source)
12121212
#ifndefUSE_PREFETCH
12131213
if (*newval!=0)
12141214
{
1215-
GUC_check_errdetail("\"effective_io_concurrency\" must be set to 0 on platforms that lack support for issuing read-ahead advice.");
1215+
GUC_check_errdetail("\"%s\" must be set to 0 on platforms that lack support for issuing read-ahead advice.",
1216+
"effective_io_concurrency");
12161217
return false;
12171218
}
12181219
#endif/* USE_PREFETCH */
@@ -1225,7 +1226,8 @@ check_maintenance_io_concurrency(int *newval, void **extra, GucSource source)
12251226
#ifndefUSE_PREFETCH
12261227
if (*newval!=0)
12271228
{
1228-
GUC_check_errdetail("\"maintenance_io_concurrency\" must be set to 0 on platforms that lack support for issuing read-ahead advice.");
1229+
GUC_check_errdetail("\"%s\" must be set to 0 on platforms that lack support for issuing read-ahead advice.",
1230+
"maintenance_io_concurrency");
12291231
return false;
12301232
}
12311233
#endif/* USE_PREFETCH */

‎src/backend/storage/file/fd.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3971,7 +3971,8 @@ check_debug_io_direct(char **newval, void **extra, GucSource source)
39713971
#ifPG_O_DIRECT==0
39723972
if (strcmp(*newval,"")!=0)
39733973
{
3974-
GUC_check_errdetail("\"debug_io_direct\" is not supported on this platform.");
3974+
GUC_check_errdetail("\"%s\" is not supported on this platform.",
3975+
"debug_io_direct");
39753976
result= false;
39763977
}
39773978
flags=0;
@@ -4018,14 +4019,16 @@ check_debug_io_direct(char **newval, void **extra, GucSource source)
40184019
#ifXLOG_BLCKSZ<PG_IO_ALIGN_SIZE
40194020
if (result&& (flags& (IO_DIRECT_WAL |IO_DIRECT_WAL_INIT)))
40204021
{
4021-
GUC_check_errdetail("\"debug_io_direct\" is not supported for WAL because XLOG_BLCKSZ is too small");
4022+
GUC_check_errdetail("\"%s\" is not supported for WAL because %s is too small",
4023+
"debug_io_direct","XLOG_BLCKSZ");
40224024
result= false;
40234025
}
40244026
#endif
40254027
#ifBLCKSZ<PG_IO_ALIGN_SIZE
40264028
if (result&& (flags&IO_DIRECT_DATA))
40274029
{
4028-
GUC_check_errdetail("\"debug_io_direct\" is not supported for data because BLCKSZ is too small");
4030+
GUC_check_errdetail("\"%s\" is not supported for WAL because %s is too small",
4031+
"debug_io_direct","BLCKSZ");
40294032
result= false;
40304033
}
40314034
#endif

‎src/backend/utils/fmgr/dfmgr.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,35 +358,39 @@ incompatible_module_error(const char *libname,
358358
if (details.len)
359359
appendStringInfoChar(&details,'\n');
360360
appendStringInfo(&details,
361-
_("Server has FUNC_MAX_ARGS = %d, library has %d."),
362-
magic_data.funcmaxargs,
361+
/* translator: %s is a variable name and %d its values */
362+
_("Server has %s = %d, library has %d."),
363+
"FUNC_MAX_ARGS",magic_data.funcmaxargs,
363364
module_magic_data->funcmaxargs);
364365
}
365366
if (module_magic_data->indexmaxkeys!=magic_data.indexmaxkeys)
366367
{
367368
if (details.len)
368369
appendStringInfoChar(&details,'\n');
369370
appendStringInfo(&details,
370-
_("Server has INDEX_MAX_KEYS = %d, library has %d."),
371-
magic_data.indexmaxkeys,
371+
/* translator: %s is a variable name and %d its values */
372+
_("Server has %s = %d, library has %d."),
373+
"INDEX_MAX_KEYS",magic_data.indexmaxkeys,
372374
module_magic_data->indexmaxkeys);
373375
}
374376
if (module_magic_data->namedatalen!=magic_data.namedatalen)
375377
{
376378
if (details.len)
377379
appendStringInfoChar(&details,'\n');
378380
appendStringInfo(&details,
379-
_("Server has NAMEDATALEN = %d, library has %d."),
380-
magic_data.namedatalen,
381+
/* translator: %s is a variable name and %d its values */
382+
_("Server has %s = %d, library has %d."),
383+
"NAMEDATALEN",magic_data.namedatalen,
381384
module_magic_data->namedatalen);
382385
}
383386
if (module_magic_data->float8byval!=magic_data.float8byval)
384387
{
385388
if (details.len)
386389
appendStringInfoChar(&details,'\n');
387390
appendStringInfo(&details,
388-
_("Server has FLOAT8PASSBYVAL = %s, library has %s."),
389-
magic_data.float8byval ?"true" :"false",
391+
/* translator: %s is a variable name and %d its values */
392+
_("Server has %s = %s, library has %s."),
393+
"FLOAT8PASSBYVAL",magic_data.float8byval ?"true" :"false",
390394
module_magic_data->float8byval ?"true" :"false");
391395
}
392396

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp