[GENERAL] Deadlock with single update statement?

Поиск
Список
Период
Сортировка
От Rob Nikander
Тема [GENERAL] Deadlock with single update statement?
Дата
Msg-id C050217D-B373-4BF2-A707-37FB4514706F@gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] Deadlock with single update statement?
Список pgsql-general
Hi,

I’m trying to track down a deadlock happening in a live app. I’m wondering about statements like this, which select
morethan one row to update: 

     update t set num = 1 where name = ‘foo’;

It appears to be causing a deadlock, but I can’t reproduce it on my test database. Could two threads, each running this
update,get in a deadlock? In other words, are both of the following true: 

1. The update locks each row in sequence, not all at once.
2. The order of the row locking could vary from one thread to the next.

thanks,
Rob





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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: [GENERAL] Inconsistent performance with LIKE and bind variable onlong-lived connection
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Deadlock with single update statement?