Search Postgresql Archives

Re: deadlock detected, only selects (not select-for-update)

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

 



Gábor Farkas <gabor@xxxxxxxxxxxxxx> writes:

> BEGIN; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
> now a lot of selects, but nothing complicated, all of the form of "SELECT x
> FROM y WHERE a=b", with some simple joins, and SELECT DISTINCT and ORDER BY.
> END;
>
> can any of these commands cause the mentioned deadlock?

No, a plain select without a "FOR SHARE" or "FOR UPDATE" can't cause a
deadlock.

One thing to be aware of is that In 7.4 foreign keys can cause spurious
deadlocks. Two updates against different records in a table will lock the
referenced keys. If they lock the referenced keys in different orders then
it's possible for them to deaadlock. This is addressed in more recent versions
of PostgreSQL.


-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


[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