Re: is there a way log last query in pg_stat_activity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Si Chen <sichen(at)opensourcestrategies(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: is there a way log last query in pg_stat_activity
Date: 2014-08-14 16:23:53
Message-ID: 5565.1408033433@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Si Chen <sichen(at)opensourcestrategies(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rajmohan C 2014-08-14 16:39:09 How to modify parser in PostgreSQL to handle new keyword and parse it
Previous Message Si Chen 2014-08-14 16:02:39 is there a way log last query in pg_stat_activity