Re: How to inspect blocked queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Randall F(dot) Kern" <randy(at)spoke(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to inspect blocked queries
Date: 2001-03-23 04:05:17
Message-ID: 16226.985320317@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Randall F. Kern" <randy(at)spoke(dot)net> writes:
> I have an web application that sometimes hangs. When I run ps I see a
> postgresql thread that says "INSERT waiting" (I don't have the exact
> text in front of me, but it's similar to that). When this happens my
> only recourse is to restart my webserver or database.

> Now most likely I have another transaction that hasn't been committed or
> locks tables in a different order, but I don't see it in the output from
> ps. Is there anyway for me to inspect the pending queries in postgesql
> so I can track this down?

Sorry, no good way to do that at the moment. I'd suggest turning on
query logging (-d2 to the postmaster, and make sure the stderr output
is going somewhere and is not being suppressed by -S). When the hang
occurs, you can look back in the log to see what other transactions
are in progress.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2001-03-23 04:06:49 internationalizing text
Previous Message will trillich 2001-03-23 04:02:41 Re: Updates on Views?