Search Postgresql Archives

Deadlock with single update statement?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I’m trying to track down a deadlock happening in a live app. I’m wondering about statements like this, which select more than 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





-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux