Separate state from query string in pg_stat_activity

Magnus Hagander <magnus@hagander.net>

Commit: 4f42b546fd87a80be30c53a0f2c897acb826ad52
Author: Magnus Hagander <magnus@hagander.net>
Date: 2012-01-19T13:19:20Z
Releases: 9.2.0
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