Make the new pg_stat_get_activity use OUT parameters, so you don't have to
authorMagnus Hagander <magnus@hagander.net>
Thu, 8 May 2008 08:58:59 +0000 (08:58 +0000)
committerMagnus Hagander <magnus@hagander.net>
Thu, 8 May 2008 08:58:59 +0000 (08:58 +0000)
specify the column names and types. Also simplifies the view.

Per comments from Tom.

src/backend/catalog/system_views.sql
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h

index 9fa76f1516b7cf41a1d435c6ebc01961cb1ec646..0083e441507e0e8803e60ee19d434dbb4f5f0646 100644 (file)
@@ -353,12 +353,7 @@ CREATE VIEW pg_stat_activity AS
             S.backend_start,
             S.client_addr,
             S.client_port
-    FROM pg_database D, 
-            pg_stat_get_activity(NULL) AS S(datid oid, procpid int,
-               usesysid oid, current_query text, waiting boolean,
-               xact_start timestamptz, query_start timestamptz,
-               backend_start timestamptz, client_addr inet, client_port int),
-            pg_authid U 
+    FROM pg_database D, pg_stat_get_activity(NULL) AS S, pg_authid U
     WHERE S.datid = D.oid AND 
             S.usesysid = U.oid;
 
index a75163b43834bfe6da2dac05eeade9a88d153b1d..a340e1c11153f49224492636ec65585f6e8ccabe 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     200805071
+#define CATALOG_VERSION_NO     200805081
 
 #endif
index 44c61da1188f676c75d3db92eb7e4115d2ff9bb9..123eab048fd75f5201a5a892281e298429032e5e 100644 (file)
@@ -2904,7 +2904,7 @@ DATA(insert OID = 2784 (  pg_stat_get_last_autoanalyze_time PGNSP PGUID 12 1 0 f
 DESCR("statistics: last auto analyze time for a table");
 DATA(insert OID = 1936 (  pg_stat_get_backend_idset            PGNSP PGUID 12 1 100 f f t t s 0 23 "" _null_ _null_ _null_ pg_stat_get_backend_idset - _null_ _null_ ));
 DESCR("statistics: currently active backend IDs");
-DATA(insert OID = 2022 (  pg_stat_get_activity                 PGNSP PGUID 12 1 100 f f f t s 1 2249 "23" _null_ _null_ _null_ pg_stat_get_activity - _null_ _null_ ));
+DATA(insert OID = 2022 (  pg_stat_get_activity                 PGNSP PGUID 12 1 100 f f f t s 1 2249 "23" "{23,26,23,26,25,16,1184,1184,1184,869,23}" "{i,o,o,o,o,o,o,o,o,o,o}" "{pid,datid,procpid,usesysid,current_query,waiting,xact_start,query_start,backend_start,client_addr,client_port}" pg_stat_get_activity - _null_ _null_ ));
 DESCR("statistics: information about currently active backends");
 DATA(insert OID = 2026 (  pg_backend_pid                               PGNSP PGUID 12 1 0 f f t f s 0 23 "" _null_ _null_ _null_ pg_backend_pid - _null_ _null_ ));
 DESCR("statistics: current backend PID");