Re: [GENERAL] How to detect Postgres deadlocks?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [GENERAL] How to detect Postgres deadlocks?
Дата
Msg-id 200608232239.22827.peter_e@gmx.net
обсуждение исходный текст
Список pgsql-admin
andre wrote:
> 1) Which sql queries should I use to detect deadlocks while they are
> happening? I see the deadlock info on the log file, but I'd like to
> query the database to see them as they happen...

Since deadlocks are broken up within one second, it will be hard to
actually see them.  You could crank up the deadlock timeout and then
query pg_locks and infer cycles from there.  From there you can also
move over to the statistics tables to see what the processes are
currently doing.  But the system won't actually tell you that there is
a deadlock until the timeout is over.  If you have special requirements
like that, you need to patch the source.

The other option is to decorate your server log lines with pids and such
that you can link from the deadlock error message to the logged
statements.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Slow delete/insert.
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: [GENERAL] How to detect Postgres deadlocks?