Re: query stuck at SOCK_wait_for_ready function call

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: query stuck at SOCK_wait_for_ready function call
Date: 2010-12-31 14:56:04
Message-ID: 20101231145603.GN16224@shinkuro.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)crankycanuck(dot)ca

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-12-31 15:34:00 Re: seg fault crashed the postmaster
Previous Message Dmitriy Igrishin 2010-12-31 14:39:22 Re: Row-level permissions?