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

SVN Commit by dpage: r4760 - in trunk/pgadmin3: . src/frm

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4760 - in trunk/pgadmin3: . src/frm
Date: 2005-11-25 11:37:41
Message-ID: 200511251137.jAPBbfW2019107@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
Author: dpage
Date: 2005-11-25 11:37:41 +0000 (Fri, 25 Nov 2005)
New Revision: 4760

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/frm/frmStatus.cpp
Log:
Fix the server status SQL query

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt	2005-11-25 08:45:59 UTC (rev 4759)
+++ trunk/pgadmin3/CHANGELOG.txt	2005-11-25 11:37:41 UTC (rev 4760)
@@ -18,6 +18,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-11-25 DP  1.4.1  Fix the server status SQL query
     <li>2005-11-25 FGP 1.4.1  Don't include pgAgent in the Mac OSX bundle
     <li>2005-11-25 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

Modified: trunk/pgadmin3/src/frm/frmStatus.cpp
===================================================================
--- trunk/pgadmin3/src/frm/frmStatus.cpp	2005-11-25 08:45:59 UTC (rev 4759)
+++ trunk/pgadmin3/src/frm/frmStatus.cpp	2005-11-25 11:37:41 UTC (rev 4760)
@@ -358,22 +358,26 @@
 		long row=0;
 		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");
+            sql = wxT("SELECT ")
+                  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");
+            sql = wxT("SELECT ")
+                  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:40:39
Subject: SVN Commit by dpage: r4761 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/frm
Previous:From: Dave PageDate: 2005-11-25 08:52:21
Subject: Re: [PATCH] Add pg_dump/pg_restore to appbundle + some cleanups.

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