Separate state from query string in pg_stat_activity
Magnus Hagander <magnus@hagander.net>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/monitoring.sgml | modified | +219 −14 |
| src/backend/catalog/system_views.sql | modified | +6 −4 |
| src/backend/postmaster/autovacuum.c | modified | +1 −1 |
| src/backend/postmaster/pgstat.c | modified | +44 −11 |
| src/backend/tcop/postgres.c | modified | +8 −8 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +75 −41 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.h | modified | +2 −2 |
| src/include/pgstat.h | modified | +20 −1 |
| src/test/regress/expected/rules.out | modified | +2 −2 |