File 0002-basic-support-postgresql10.patch of Package pgadmin3
diff -rup a/pgadmin/include/pgAdmin3.h b/pgadmin/include/pgAdmin3.h
--- a/pgadmin/include/pgAdmin3.h 2017-11-24 17:56:53.943413312 +0100
+++ b/pgadmin/include/pgAdmin3.h 2017-11-24 18:02:39.052637799 +0100
@@ -58,8 +58,8 @@
// Supported server minimum and maximum values.
const short SERVER_MIN_VERSION_N = 0x0804;
const wxString SERVER_MIN_VERSION_T = wxT("8.4");
-const short SERVER_MAX_VERSION_N = 0x0906;
-const wxString SERVER_MAX_VERSION_T = wxT("9.6");
+const short SERVER_MAX_VERSION_N = 0x0A00;
+const wxString SERVER_MAX_VERSION_T = wxT("10.0");
// Supported Greenplum Database and Greenplum HAWQ minimum and maximum values.
const short GP_MIN_VERSION_N = 0x0802;
diff -rup a/pgadmin/schema/pgServer.cpp b/pgadmin/schema/pgServer.cpp
--- a/pgadmin/schema/pgServer.cpp 2017-11-24 17:56:53.983413455 +0100
+++ b/pgadmin/schema/pgServer.cpp 2017-11-24 18:55:43.102941932 +0100
@@ -905,13 +905,28 @@ int pgServer::Connect(frmMain *form, boo
if (conn->BackendMinimumVersion(8, 5))
{
sql += wxT(", CASE WHEN usesuper THEN pg_is_in_recovery() ELSE NULL END as inrecovery");
- sql += wxT(", CASE WHEN usesuper THEN pg_last_xlog_receive_location() ELSE NULL END as receiveloc");
- sql += wxT(", CASE WHEN usesuper THEN pg_last_xlog_replay_location() ELSE NULL END as replayloc");
+ if (conn->BackendMinimumVersion(10, 0))
+ {
+ sql += wxT(", CASE WHEN usesuper THEN pg_last_wal_receive_lsn() ELSE NULL END as receiveloc");
+ sql += wxT(", CASE WHEN usesuper THEN pg_last_wal_replay_lsn() ELSE NULL END as replayloc");
+ }
+ else
+ {
+ sql += wxT(", CASE WHEN usesuper THEN pg_last_xlog_receive_location() ELSE NULL END as receiveloc");
+ sql += wxT(", CASE WHEN usesuper THEN pg_last_xlog_replay_location() ELSE NULL END as replayloc");
+ }
}
if (conn->BackendMinimumVersion(9, 1))
{
sql += wxT(", CASE WHEN usesuper THEN pg_last_xact_replay_timestamp() ELSE NULL END as replay_timestamp");
- sql += wxT(", CASE WHEN usesuper AND pg_is_in_recovery() THEN pg_is_xlog_replay_paused() ELSE NULL END as isreplaypaused");
+ if (conn->BackendMinimumVersion(10, 0))
+ {
+ sql += wxT(", CASE WHEN usesuper AND pg_is_in_recovery() THEN pg_is_wal_replay_paused() ELSE NULL END as isreplaypaused");
+ }
+ else
+ {
+ sql += wxT(", CASE WHEN usesuper AND pg_is_in_recovery() THEN pg_is_xlog_replay_paused() ELSE NULL END as isreplaypaused");
+ }
}
pgSet *set = ExecuteSet(sql + wxT("\n FROM pg_user WHERE usename=current_user"));