Thread: pg_stat_activity.current_query explanation?

pg_stat_activity.current_query explanation?

From
Pat Chan
Date:
Hello,

I'm using postgresql 8.1.5. Sorry if this is not the right area to ask this. I already have command string turned on at the postgresql.conf , and am currently trying to troubleshoot some connection problem at a server that is causing performance issues. Apart from "<IDLE>" and the specific SQL commands that the clients have issued, I'm seeing two things that I cannot seem to explain:

One is '<IDLE in transaction>' and the other is simply the word 'end'. 

I googled everywhere about this but to not avail. If you could shed some light on this subject that would be great!

Thank you in advance.


Faster Hotmail access now on the new MSN homepage.

Re: pg_stat_activity.current_query explanation?

From
Joshua Tolley
Date:
On Wed, Sep 02, 2009 at 11:29:14AM -0400, Pat Chan wrote:
>    One is '<IDLE in transaction>' and the other is simply the word 'end'.
>    I googled everywhere about this but to not avail. If you could shed some
>    light on this subject that would be great!
>    Thank you in advance.

'<IDLE in transaction>' means that the client has opened a transaction but
isn't doing anything right now. If you issue a "BEGIN;" command and then just
sit there, for instance, you'll see these.

'END' is synonymous with 'COMMIT', so where those show up, it means the client
is in the middle of committing a transaction.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Attachment