Refactor server version detection

Most of the time we can simply get the version number directly from
the connection handle. Previously it was held in a global variable,
which was an icky way of doing things.

In a few special cases we also need the actual version string, which
is obtained directly from the database.
This commit is contained in:
Ian Barwick
2018-11-22 20:34:01 +09:00
parent 0f4e04e61e
commit 793d83b22c
6 changed files with 45 additions and 122 deletions

View File

@@ -372,12 +372,6 @@ main(int argc, char **argv)
/* abort if local node not available at startup */
local_conn = establish_db_connection(config_file_options.conninfo, true);
/*
* store the server version number - we'll need this to generate
* version-dependent queries etc.
*/
server_version_num = get_server_version(local_conn, NULL);
/*
* sanity checks
*