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

pgsql: Separate state from query string in pg_stat_activity

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Separate state from query string in pg_stat_activity
Date: 2012-01-19 13:30:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Separate state from query string in pg_stat_activity

This separates the state (running/idle/idleintransaction etc) into
it's own field ("state"), and leaves the query field containing just
query text.

The query text will now mean "current query" when a query is running
and "last query" in other states. Accordingly,the field has been
renamed from current_query to query.

Since backwards compatibility was broken anyway to make that, the procpid
field has also been renamed to pid - along with the same field in
pg_stat_replication for consistency.

Scott Mead and Magnus Hagander, review work from Greg Smith



Modified Files
doc/src/sgml/monitoring.sgml         |  233 ++++++++++++++++++++++++++++++++--
src/backend/catalog/system_views.sql |   10 +-
src/backend/postmaster/autovacuum.c  |    2 +-
src/backend/postmaster/pgstat.c      |   55 +++++++--
src/backend/tcop/postgres.c          |   16 +-
src/backend/utils/adt/pgstatfuncs.c  |  116 +++++++++++------
src/include/catalog/catversion.h     |    2 +-
src/include/catalog/pg_proc.h        |    4 +-
src/include/pgstat.h                 |   21 +++-
src/test/regress/expected/rules.out  |    4 +-
10 files changed, 378 insertions(+), 85 deletions(-)

pgsql-committers by date

Next:From: Robert HaasDate: 2012-01-19 20:26:05
Subject: pgsql: Add bitwise AND, OR, and NOT operators for macaddr data type.
Previous:From: Heikki LinnakangasDate: 2012-01-19 11:18:12
Subject: pgsql: Make pg_relation_size() and friends return NULL if the objectdo

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