is there a way log last query in pg_stat_activity

Started by Si Chenover 11 years ago2 messagesgeneral
Jump to latest
#1Si Chen
sichen@opensourcestrategies.com

I'm using Postgresql 9.0, and my pg_stat_activity.query seems to always be
showing <IDLE> when no query is being run.

Is there a way for it to show the last query, even if it was run a while
ago?

--
Si Chen
Open Source Strategies, Inc.
twitter.com/opentaps

Unify social, email, and business communications with opentaps CRM2 for
Android
<https://play.google.com/store/apps/details?id=com.opentaps.crm2client&gt;,
iPad/iPhone <https://itunes.apple.com/us/app/opentaps-crm2/id899333198&gt;,
Gmail
<https://chrome.google.com/webstore/detail/opentaps-crm2/apkbgpfokhbplllnjkndenaopihfiaop&gt;
- It's Free!

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Si Chen (#1)
Re: is there a way log last query in pg_stat_activity

Si Chen <sichen@opensourcestrategies.com> writes:

I'm using Postgresql 9.0, and my pg_stat_activity.query seems to always be
showing <IDLE> when no query is being run.

Is there a way for it to show the last query, even if it was run a while
ago?

More recent versions act that way. There is no way to make 9.0.x do it
short of patching the source code.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general