Re: query stuck at SOCK_wait_for_ready function call

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: query stuck at SOCK_wait_for_ready function call
Дата
Msg-id 20101231145603.GN16224@shinkuro.com
обсуждение исходный текст
Ответ на Re: query stuck at SOCK_wait_for_ready function call  ("tamanna madaan" <tamanna.madan@globallogic.com>)
Список 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 по дате отправления:

Предыдущее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: Row-level permissions?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: seg fault crashed the postmaster