Check minimum server version for pg_rewind

This commit is contained in:
Ian Barwick
2017-08-31 13:30:59 +09:00
parent 705b52fde4
commit ed16c32fe7
2 changed files with 13 additions and 2 deletions

View File

@@ -1316,6 +1316,17 @@ can_use_pg_rewind(PGconn *conn, const char *data_directory, PQExpBufferData *rea
{
bool can_use = true;
if (server_version_num == UNKNOWN_SERVER_VERSION_NUM)
server_version_num = get_server_version(conn, NULL);
if (server_version_num < 90500)
{
appendPQExpBuffer(
reason,
_("pg_rewind available from PostgreSQL 9.5"));
return false;
}
if (guc_set(conn, "full_page_writes", "=", "off"))
{
if (can_use == false)

View File

@@ -26,8 +26,8 @@
#include "dbutils.h"
#include "log.h"
#define MIN_SUPPORTED_VERSION "9.5"
#define MIN_SUPPORTED_VERSION_NUM 90500
#define MIN_SUPPORTED_VERSION "9.4"
#define MIN_SUPPORTED_VERSION_NUM 90400
#define REPLICATION_TYPE_PHYSICAL 1
#define REPLICATION_TYPE_BDR 2