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: E1Rns4D-0004t4-10@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox
Thread:
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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4f42b546fd87a80be30c53a0f2c897acb826ad52

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(-)

Browse pgsql-committers by date

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