mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 00:46:29 +00:00
Replace the function is_supported_version() with the function pg_version()
the main difference is that this new function doesn't return a bool but a string representing the current major version of the postgresql server or an empty string if it's earlier than 9.0. Teach all commands that could connect to master and standby that they both should have the same major version.
This commit is contained in:
10
repmgrd.c
10
repmgrd.c
@@ -81,6 +81,7 @@ main(int argc, char **argv)
|
||||
int c;
|
||||
|
||||
char conninfo[MAXLEN];
|
||||
const char *standby_version = NULL;
|
||||
|
||||
progname = get_progname(argv[0]);
|
||||
|
||||
@@ -136,6 +137,15 @@ main(int argc, char **argv)
|
||||
|
||||
myLocalConn = establishDBConnection(conninfo, true);
|
||||
|
||||
/* should be v9 or better */
|
||||
standby_version = pg_version(myLocalConn);
|
||||
if (strcmp(standby_version, "") == 0)
|
||||
{
|
||||
PQfinish(myLocalConn);
|
||||
fprintf(stderr, _("%s needs standby to be PostgreSQL 9.0 or better\n"), progname);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set my server mode, establish a connection to primary
|
||||
* and start monitor
|
||||
|
||||
Reference in New Issue
Block a user