Skip site navigation (1) Skip section navigation (2)

SVN Commit by dpage: r4761 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/frm

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4761 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/frm
Date: 2005-11-25 11:40:39
Message-ID: 200511251140.jAPBedJq019151@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
Author: dpage
Date: 2005-11-25 11:40:38 +0000 (Fri, 25 Nov 2005)
New Revision: 4761

Modified:
   branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt
   branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmStatus.cpp
Log:
Fix the server status SQL query

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt
===================================================================
--- branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt	2005-11-25 11:37:41 UTC (rev 4760)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt	2005-11-25 11:40:38 UTC (rev 4761)
@@ -18,6 +18,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-11-25 DP  1.4.1  Fix the server status SQL query
     <li>2005-11-20 FGP 1.4.1  Include pg_dump/pg_restore in the Mac OSX bundle
     <li>2005-11-20 DP  1.4.1  Use a proper 'Save As' style dialogue for selecting backup files
     <li>2005-11-20 AP  1.4.1  Don't show pk hint when editing view

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmStatus.cpp
===================================================================
--- branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmStatus.cpp	2005-11-25 11:37:41 UTC (rev 4760)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmStatus.cpp	2005-11-25 11:40:38 UTC (rev 4761)
@@ -359,21 +359,25 @@
 		wxString sql;
 		if (connection->BackendMinimumVersion(7, 4)) {
 			sql = wxT("SELECT ")
-				  wxT("(SELECT datname FROM pg_database WHERE oid = database) AS dbname, ")
-				  wxT("relation::regclass AS class, ")
-				  wxT("pg_get_userbyid(pg_stat_get_backend_userid(pid)::int4) as user, ")
-				  wxT("transaction, pid, mode, granted, ")
-				  wxT("pg_stat_get_backend_activity(pid) AS current_query, ")
-				  wxT("pg_stat_get_backend_activity_start(pid) AS query_start ")
-				  wxT("FROM pg_locks ORDER BY pid");
+			      wxT("(SELECT datname FROM pg_database WHERE oid = pgl.database) AS dbname, ")
+			      wxT("pgl.relation::regclass AS class, ")
+			      wxT("pg_get_userbyid(pg_stat_get_backend_userid(svrid)) as user, ")
+			      wxT("pgl.transaction, pg_stat_get_backend_pid(svrid) AS pid, pgl.mode, pgl.granted, ")
+			      wxT("pg_stat_get_backend_activity(svrid) AS current_query, ")
+			      wxT("pg_stat_get_backend_activity_start(svrid) AS query_start ")
+			      wxT("FROM pg_stat_get_backend_idset() svrid, pg_locks pgl ")
+			      wxT("WHERE pgl.pid = pg_stat_get_backend_pid(svrid) ")
+			      wxT("ORDER BY pid;");
 		} else {
 			sql = wxT("SELECT ")
-				  wxT("(SELECT datname FROM pg_database WHERE oid = database) AS dbname, ")
-				  wxT("relation::regclass AS class, ")
-				  wxT("pg_get_userbyid(pg_stat_get_backend_userid(pid)::int4) as user, ")
-				  wxT("transaction, pid, mode, granted, ")
-				  wxT("pg_stat_get_backend_activity(pid) AS current_query ")
-				  wxT("FROM pg_locks ORDER BY pid");
+			      wxT("(SELECT datname FROM pg_database WHERE oid = pgl.database) AS dbname, ")
+			      wxT("pgl.relation::regclass AS class, ")
+			      wxT("pg_get_userbyid(pg_stat_get_backend_userid(svrid)) as user, ")
+			      wxT("pgl.transaction, pg_stat_get_backend_pid(svrid) AS pid, pgl.mode, pgl.granted, ")
+			      wxT("pg_stat_get_backend_activity(svrid) AS current_query ")
+			      wxT("FROM pg_stat_get_backend_idset() svrid, pg_locks pgl ")
+			      wxT("WHERE pgl.pid = pg_stat_get_backend_pid(svrid) ")
+			      wxT("ORDER BY pid;");
 		}
 
 		pgSet *dataSet2=connection->ExecuteSet(sql);


pgadmin-hackers by date

Next:From: svnDate: 2005-11-25 11:42:01
Subject: SVN Commit by dpage: r4762 - branches/REL-1_4_0_PATCHES/pgadmin3
Previous:From: svnDate: 2005-11-25 11:37:41
Subject: SVN Commit by dpage: r4760 - in trunk/pgadmin3: . src/frm

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group