Re: Deadlock on the same object?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Deadlock on the same object?
Дата
Msg-id 6027.1257951958@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Deadlock on the same object?  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Ответы Re: Deadlock on the same object?
Список pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
> I encountered the following log in 8.4.1 and HEAD. The deadlock occured
> on the same object (relation 17498 of database 17497). Is it reasonable?

I think this is an artifact of the fact that SQL functions parse the
whole querystring before executing any of it.  Parsing of "DELETE FROM
a" will result in acquiring ROW EXCLUSIVE lock on a, and then when the
LOCK commands are executed, you have a lock-upgrade scenario and the
deadlock is unsurprising.

There was some discussion of changing that awhile ago, but I forget
what the conclusion was.  In any case nothing's been done about it.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: total execution time as reported by auto_explain
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Hot standby, freezing