Skip to content

Commit 3aad76a

Browse files
committed
Make pg_upgrade log message with control file path translatable.
Commit 173c978 replaced the hardcoded "global/pg_control" in pg_upgrade log message with a string literal concatenation of XLOG_CONTROL_FILE macro. However, this change made the message untranslatable. This commit fixes the issue by using %s with XLOG_CONTROL_FILE instead of that literal concatenation, allowing the message to be translated properly. It also wraps the file path in double quotes for consistency with similar log messages. Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Masao Fujii <masao.fujii@gmail.com> Discussion: https://postgr.es/m/20250407.155546.2129693791769531891.horikyota.ntt@gmail.com
1 parent 05883bd commit 3aad76a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bin/pg_upgrade/controldata.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,8 @@ disable_old_cluster(transferMode transfer_mode)
758758
new_path[MAXPGPATH];
759759

760760
/* rename pg_control so old server cannot be accidentally started */
761-
prep_status("Adding \".old\" suffix to old " XLOG_CONTROL_FILE);
761+
/* translator: %s is the file path of the control file */
762+
prep_status("Adding \".old\" suffix to old \"%s\"", XLOG_CONTROL_FILE);
762763

763764
snprintf(old_path, sizeof(old_path), "%s/%s", old_cluster.pgdata, XLOG_CONTROL_FILE);
764765
snprintf(new_path, sizeof(new_path), "%s/%s.old", old_cluster.pgdata, XLOG_CONTROL_FILE);
@@ -768,9 +769,10 @@ disable_old_cluster(transferMode transfer_mode)
768769
check_ok();
769770

770771
if (transfer_mode == TRANSFER_MODE_LINK)
772+
/* translator: %s/%s is the file path of the control file */
771773
pg_log(PG_REPORT, "\n"
772774
"If you want to start the old cluster, you will need to remove\n"
773-
"the \".old\" suffix from %s/%s.old.\n"
775+
"the \".old\" suffix from \"%s/%s.old\".\n"
774776
"Because \"link\" mode was used, the old cluster cannot be safely\n"
775777
"started once the new cluster has been started.",
776778
old_cluster.pgdata, XLOG_CONTROL_FILE);

0 commit comments

Comments
 (0)