Mark some untranslatable messages with errmsg_internal

This commit is contained in:
Alvaro Herrera 2011-09-05 17:47:18 -03:00
parent a2a5ce6826
commit b64f18c583

View File

@ -5306,22 +5306,22 @@ readRecoveryCommandFile(void)
{ {
recoveryRestoreCommand = pstrdup(item->value); recoveryRestoreCommand = pstrdup(item->value);
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("restore_command = '%s'", (errmsg_internal("restore_command = '%s'",
recoveryRestoreCommand))); recoveryRestoreCommand)));
} }
else if (strcmp(item->name, "recovery_end_command") == 0) else if (strcmp(item->name, "recovery_end_command") == 0)
{ {
recoveryEndCommand = pstrdup(item->value); recoveryEndCommand = pstrdup(item->value);
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("recovery_end_command = '%s'", (errmsg_internal("recovery_end_command = '%s'",
recoveryEndCommand))); recoveryEndCommand)));
} }
else if (strcmp(item->name, "archive_cleanup_command") == 0) else if (strcmp(item->name, "archive_cleanup_command") == 0)
{ {
archiveCleanupCommand = pstrdup(item->value); archiveCleanupCommand = pstrdup(item->value);
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("archive_cleanup_command = '%s'", (errmsg_internal("archive_cleanup_command = '%s'",
archiveCleanupCommand))); archiveCleanupCommand)));
} }
else if (strcmp(item->name, "pause_at_recovery_target") == 0) else if (strcmp(item->name, "pause_at_recovery_target") == 0)
{ {
@ -5330,7 +5330,8 @@ readRecoveryCommandFile(void)
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("parameter \"%s\" requires a Boolean value", "pause_at_recovery_target"))); errmsg("parameter \"%s\" requires a Boolean value", "pause_at_recovery_target")));
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("pause_at_recovery_target = '%s'", item->value))); (errmsg_internal("pause_at_recovery_target = '%s'",
item->value)));
} }
else if (strcmp(item->name, "recovery_target_timeline") == 0) else if (strcmp(item->name, "recovery_target_timeline") == 0)
{ {
@ -5348,10 +5349,10 @@ readRecoveryCommandFile(void)
} }
if (rtli) if (rtli)
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("recovery_target_timeline = %u", rtli))); (errmsg_internal("recovery_target_timeline = %u", rtli)));
else else
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("recovery_target_timeline = latest"))); (errmsg_internal("recovery_target_timeline = latest")));
} }
else if (strcmp(item->name, "recovery_target_xid") == 0) else if (strcmp(item->name, "recovery_target_xid") == 0)
{ {
@ -5362,8 +5363,8 @@ readRecoveryCommandFile(void)
(errmsg("recovery_target_xid is not a valid number: \"%s\"", (errmsg("recovery_target_xid is not a valid number: \"%s\"",
item->value))); item->value)));
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("recovery_target_xid = %u", (errmsg_internal("recovery_target_xid = %u",
recoveryTargetXid))); recoveryTargetXid)));
recoveryTarget = RECOVERY_TARGET_XID; recoveryTarget = RECOVERY_TARGET_XID;
} }
else if (strcmp(item->name, "recovery_target_time") == 0) else if (strcmp(item->name, "recovery_target_time") == 0)
@ -5386,8 +5387,8 @@ readRecoveryCommandFile(void)
ObjectIdGetDatum(InvalidOid), ObjectIdGetDatum(InvalidOid),
Int32GetDatum(-1))); Int32GetDatum(-1)));
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("recovery_target_time = '%s'", (errmsg_internal("recovery_target_time = '%s'",
timestamptz_to_str(recoveryTargetTime)))); timestamptz_to_str(recoveryTargetTime))));
} }
else if (strcmp(item->name, "recovery_target_name") == 0) else if (strcmp(item->name, "recovery_target_name") == 0)
{ {
@ -5403,11 +5404,12 @@ readRecoveryCommandFile(void)
if (strlen(recoveryTargetName) >= MAXFNAMELEN) if (strlen(recoveryTargetName) >= MAXFNAMELEN)
ereport(FATAL, ereport(FATAL,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("recovery_target_name is too long (maximum %d characters)", MAXFNAMELEN - 1))); errmsg("recovery_target_name is too long (maximum %d characters)",
MAXFNAMELEN - 1)));
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("recovery_target_name = '%s'", (errmsg_internal("recovery_target_name = '%s'",
recoveryTargetName))); recoveryTargetName)));
} }
else if (strcmp(item->name, "recovery_target_inclusive") == 0) else if (strcmp(item->name, "recovery_target_inclusive") == 0)
{ {
@ -5417,32 +5419,35 @@ readRecoveryCommandFile(void)
if (!parse_bool(item->value, &recoveryTargetInclusive)) if (!parse_bool(item->value, &recoveryTargetInclusive))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("parameter \"%s\" requires a Boolean value", "recovery_target_inclusive"))); errmsg("parameter \"%s\" requires a Boolean value",
"recovery_target_inclusive")));
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("recovery_target_inclusive = %s", item->value))); (errmsg_internal("recovery_target_inclusive = %s",
item->value)));
} }
else if (strcmp(item->name, "standby_mode") == 0) else if (strcmp(item->name, "standby_mode") == 0)
{ {
if (!parse_bool(item->value, &StandbyMode)) if (!parse_bool(item->value, &StandbyMode))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("parameter \"%s\" requires a Boolean value", "standby_mode"))); errmsg("parameter \"%s\" requires a Boolean value",
"standby_mode")));
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("standby_mode = '%s'", item->value))); (errmsg_internal("standby_mode = '%s'", item->value)));
} }
else if (strcmp(item->name, "primary_conninfo") == 0) else if (strcmp(item->name, "primary_conninfo") == 0)
{ {
PrimaryConnInfo = pstrdup(item->value); PrimaryConnInfo = pstrdup(item->value);
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("primary_conninfo = '%s'", (errmsg_internal("primary_conninfo = '%s'",
PrimaryConnInfo))); PrimaryConnInfo)));
} }
else if (strcmp(item->name, "trigger_file") == 0) else if (strcmp(item->name, "trigger_file") == 0)
{ {
TriggerFile = pstrdup(item->value); TriggerFile = pstrdup(item->value);
ereport(DEBUG2, ereport(DEBUG2,
(errmsg("trigger_file = '%s'", (errmsg_internal("trigger_file = '%s'",
TriggerFile))); TriggerFile)));
} }
else else
ereport(FATAL, ereport(FATAL,
@ -7978,7 +7983,8 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
if (RmgrTable[rmid].rm_safe_restartpoint != NULL) if (RmgrTable[rmid].rm_safe_restartpoint != NULL)
if (!(RmgrTable[rmid].rm_safe_restartpoint())) if (!(RmgrTable[rmid].rm_safe_restartpoint()))
{ {
elog(trace_recovery(DEBUG2), "RM %d not safe to record restart point at %X/%X", elog(trace_recovery(DEBUG2),
"RM %d not safe to record restart point at %X/%X",
rmid, rmid,
checkPoint->redo.xlogid, checkPoint->redo.xlogid,
checkPoint->redo.xrecoff); checkPoint->redo.xrecoff);