summaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2006-12-06 18:06:48 +0000
committerNeil Conway <neilc@samurai.com>2006-12-06 18:06:48 +0000
commit886a02d1cb19fe25859bd3c2d1f6a64b04cdc710 (patch)
treea0684de747e49ba23b5c7fead1052d378ecbb4dd /src/include/pgstat.h
parentdd740e1fd066a5df628ba28dfdaee02d58dee0c5 (diff)
Add a txn_start column to pg_stat_activity. This makes it easier to
identify long-running transactions. Since we already need to record the transaction-start time (e.g. for now()), we don't need any additional system calls to report this information. Catversion bumped, initdb required.
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 8f5db770795..a702ad82888 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.50 2006/10/04 00:30:06 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.51 2006/12/06 18:06:47 neilc Exp $
* ----------
*/
#ifndef PGSTAT_H
@@ -325,8 +325,9 @@ typedef struct PgBackendStatus
/* The entry is valid iff st_procpid > 0, unused if st_procpid == 0 */
int st_procpid;
- /* Times of backend process start and current activity start */
+ /* Times when current backend, transaction, and activity started */
TimestampTz st_proc_start_timestamp;
+ TimestampTz st_txn_start_timestamp;
TimestampTz st_activity_start_timestamp;
/* Database OID, owning user's OID, connection client address */
@@ -390,6 +391,7 @@ extern void pgstat_report_analyze(Oid tableoid, bool shared,
extern void pgstat_bestart(void);
extern void pgstat_report_activity(const char *what);
+extern void pgstat_report_txn_timestamp(TimestampTz tstamp);
extern void pgstat_report_waiting(bool waiting);
extern void pgstat_initstats(PgStat_Info *stats, Relation rel);