diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-19 01:36:34 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-19 01:36:34 +0000 |
| commit | 9bf760f7dec703aa34d9bd68aaa982943d24411e (patch) | |
| tree | f36eed206a58dce384a76c27f77213a6444aaef7 /src/include | |
| parent | 1be439084a380bc3f1576e2a2834839e508122dd (diff) | |
| download | postgresql-9bf760f7dec703aa34d9bd68aaa982943d24411e.tar.gz | |
Add a 'waiting' column to pg_stat_activity to carry the same information
that ps_status provides by appending 'waiting' to the PS display. This
completes the project of making it feasible to turn off process title
updates and instead rely on pg_stat_activity. Per my suggestion a few
weeks ago.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.h | 4 | ||||
| -rw-r--r-- | src/include/pgstat.h | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 6728188e50..b27acf5f85 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.350 2006/08/17 23:04:08 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.351 2006/08/19 01:36:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200608171 +#define CATALOG_VERSION_NO 200608181 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 93a1e0c1ed..b066babc14 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.421 2006/08/17 23:04:10 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.422 2006/08/19 01:36:33 tgl Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -2898,6 +2898,8 @@ DATA(insert OID = 1939 ( pg_stat_get_backend_userid PGNSP PGUID 12 f f t f s 1 DESCR("Statistics: User ID of backend"); DATA(insert OID = 1940 ( pg_stat_get_backend_activity PGNSP PGUID 12 f f t f s 1 25 "23" _null_ _null_ _null_ pg_stat_get_backend_activity - _null_ )); DESCR("Statistics: Current query of backend"); +DATA(insert OID = 2853 ( pg_stat_get_backend_waiting PGNSP PGUID 12 f f t f s 1 16 "23" _null_ _null_ _null_ pg_stat_get_backend_waiting - _null_ )); +DESCR("Statistics: Is backend currently waiting for a lock"); DATA(insert OID = 2094 ( pg_stat_get_backend_activity_start PGNSP PGUID 12 f f t f s 1 1184 "23" _null_ _null_ _null_ pg_stat_get_backend_activity_start - _null_)); DESCR("Statistics: Start time for current query of backend"); DATA(insert OID = 1391 ( pg_stat_get_backend_start PGNSP PGUID 12 f f t f s 1 1184 "23" _null_ _null_ _null_ pg_stat_get_backend_start - _null_)); diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 72e542f16c..35614eaa2d 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.48 2006/06/29 20:00:08 tgl Exp $ + * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.49 2006/08/19 01:36:34 tgl Exp $ * ---------- */ #ifndef PGSTAT_H @@ -334,6 +334,9 @@ typedef struct PgBackendStatus Oid st_userid; SockAddr st_clientaddr; + /* Is backend currently waiting on an lmgr lock? */ + bool st_waiting; + /* current command string; MUST be null-terminated */ char st_activity[PGBE_ACTIVITY_SIZE]; } PgBackendStatus; @@ -387,6 +390,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_waiting(bool waiting); extern void pgstat_initstats(PgStat_Info *stats, Relation rel); |
