Re: query stuck at SOCK_wait_for_ready function call - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: query stuck at SOCK_wait_for_ready function call
Date
Msg-id 20101231145603.GN16224@shinkuro.com
Whole thread Raw
In response to Re: query stuck at SOCK_wait_for_ready function call  ("tamanna madaan" <tamanna.madan@globallogic.com>)
List pgsql-general
On Fri, Dec 31, 2010 at 09:44:43AM +0530, tamanna madaan wrote:

> However, This is not a very long running query.
> This was supposed to update only one row in a table.

That it's supposed to update only one row does not mean it wasn't a
very long running query.

> Moreover, it cant be waiting for a lock as
> other processes were able to update the same table at the same time.

I don't see how that follows.  Postgres doesn't normally lock the
whole table.

> restarting the process which was stuck because of this query, also
> resolved the issue. That means after restart, the process was able to
> update the same table. Had it been waiting for a lock before , it wouldn't
> have been able to update the table after restart either.

I don't think that's true.  If you restarted, you killed all the
outstanding operations.  If something previously had a lock that was
blocking your query, that lock was removed.  Now your query can go
through.

In order to know whether there is a problem with a lock, you can use
the pg_locks system view.  Documentation is in the manual:
http://www.postgresql.org/docs/9.0/interactive/view-pg-locks.html (or,
for your release,
http://www.postgresql.org/docs/8.1/interactive/view-pg-locks.html).

By the way, the advice you got yesterday about upgrading is good
advice.  I wouldn't keep running the version you're running.

A

--
Andrew Sullivan
ajs@crankycanuck.ca

pgsql-general by date:

Previous
From: Dmitriy Igrishin
Date:
Subject: Re: Row-level permissions?
Next
From: Tom Lane
Date:
Subject: Re: seg fault crashed the postmaster