From 0d42b771f5452bf6f73d677efd16922a023f3242 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 6 Jun 2016 23:41:47 +0900 Subject: [PATCH] Remove unnecessary get_server_version() calls in do_standby_clone() We cache the value at the start of the function, and it's reasonable to assume that the server version is not going to suddenly change. --- repmgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repmgr.c b/repmgr.c index 3580e7a2..c8a0b7cf 100644 --- a/repmgr.c +++ b/repmgr.c @@ -1412,7 +1412,7 @@ do_standby_clone(void) if (*runtime_options.recovery_min_apply_delay) { - if (get_server_version(upstream_conn, NULL) < 90400) + if (server_version_num < 90400) { log_err(_("PostgreSQL 9.4 or greater required for --recovery-min-apply-delay\n")); PQfinish(upstream_conn); @@ -1436,7 +1436,7 @@ do_standby_clone(void) { TablespaceListCell *cell; - if (get_server_version(upstream_conn, NULL) < 90400 && !runtime_options.rsync_only) + if (server_version_num < 90400 && !runtime_options.rsync_only) { log_err(_("in PostgreSQL 9.3, tablespace mapping can only be used in conjunction with --rsync-only\n")); PQfinish(upstream_conn); @@ -1878,7 +1878,7 @@ do_standby_clone(void) } else { - r = run_basebackup(local_data_directory, get_server_version(upstream_conn, NULL)); + r = run_basebackup(local_data_directory, server_version_num); if (r != 0) { log_warning(_("standby clone: base backup failed\n"));