Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6
authorMuhammad Usama <m.usama@gmail.com>
Fri, 12 Feb 2016 12:30:10 +0000 (17:30 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Fri, 12 Feb 2016 12:37:25 +0000 (17:37 +0500)
Incorporating the change of function signature for GetConfigOption..()
functions in PostgreSQL 9.6

sql/pgpool-recovery/pgpool-recovery.c

index 3af698238935b754c9219262ffad7d59476b4483..6db323bc507077cc479903865702f77f1f5d05e2 100644 (file)
@@ -144,8 +144,13 @@ pgpool_pgctl(PG_FUNCTION_ARGS)
                elog(ERROR, "must be superuser to use pgpool_pgctl function");
 #endif
 
+#if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 90600)
+       pg_ctl = GetConfigOptionByName("pgpool.pg_ctl", NULL,false);
+       data_directory = GetConfigOptionByName("data_directory", NULL,false);
+#else
        pg_ctl = GetConfigOptionByName("pgpool.pg_ctl", NULL);
        data_directory = GetConfigOptionByName("data_directory", NULL);
+#endif
 
        if (strcmp(stop_mode, "") != 0)
        {