is there a way log last query in pg_stat_activity

From: Si Chen <sichen(at)opensourcestrategies(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: is there a way log last query in pg_stat_activity
Date: 2014-08-14 16:02:39
Message-ID: CAAYSSjMLJQOX+wGDzW0zZ_U=x6Njn2q3YE1ZHpQT_ySViW7BdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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>,
iPad/iPhone <https://itunes.apple.com/us/app/opentaps-crm2/id899333198>,
Gmail
<https://chrome.google.com/webstore/detail/opentaps-crm2/apkbgpfokhbplllnjkndenaopihfiaop>
- It's Free!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-08-14 16:23:53 Re: is there a way log last query in pg_stat_activity
Previous Message Thomas Kellerer 2014-08-14 15:50:24 Re: How to cast to regprocedure with OUT parameters