From f7c232b393248201dd9c409c658b63cf7de0862f Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 20 Oct 2020 09:18:29 +0900 Subject: [PATCH] Only write "recovery_target_timeline" for PostgreSQL 11 and earlier "recovery_target_timeline" defaults to "latest" from PostgreSQL 12 (see core commit 2dedf4d9) so no need to write it explicitly. --- repmgr-action-standby.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 73c79473..0b4ca09d 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -7885,10 +7885,17 @@ create_recovery_file(t_node_info *node_record, t_conninfo_param_list *primary_co key_value_list_set(&recovery_config, "primary_conninfo", primary_conninfo_buf.data); - /* recovery_target_timeline = 'latest' */ - key_value_list_set(&recovery_config, - "recovery_target_timeline", "latest"); + /* + * recovery_target_timeline = 'latest' + * + * PostgreSQL 11 and earlier only; 'latest' is the default from PostgreSQL 12. + */ + if (server_version_num < 120000) + { + key_value_list_set(&recovery_config, + "recovery_target_timeline", "latest"); + } /* recovery_min_apply_delay = ... (optional) */ if (config_file_options.recovery_min_apply_delay_provided == true)