1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

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.
This commit is contained in:
Neil Conway
2006-12-06 18:06:48 +00:00
parent dd740e1fd0
commit 886a02d1cb
9 changed files with 77 additions and 21 deletions

View File

@@ -3,7 +3,7 @@
*
* Copyright (c) 1996-2006, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.32 2006/11/24 21:18:42 tgl Exp $
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.33 2006/12/06 18:06:47 neilc Exp $
*/
CREATE VIEW pg_roles AS
@@ -335,6 +335,7 @@ CREATE VIEW pg_stat_activity AS
U.rolname AS usename,
pg_stat_get_backend_activity(S.backendid) AS current_query,
pg_stat_get_backend_waiting(S.backendid) AS waiting,
pg_stat_get_backend_txn_start(S.backendid) AS txn_start,
pg_stat_get_backend_activity_start(S.backendid) AS query_start,
pg_stat_get_backend_start(S.backendid) AS backend_start,
pg_stat_get_backend_client_addr(S.backendid) AS client_addr,