Thread: foreign key locks

foreign key locks

From
Timur Irmatov
Date:
Hi, everyone!

On the last few days I was struck by the deadlock problem, caused by
foreign keys..

I've searched through mailing list archives and found a recent
discussion of this problem.

Also, I looked at TODO list and I don't think that corresponding item
should be among urgent ones.  This is, of course, only my opinion.
PostgreSQL is known to be highly concurrent multiuser transactional
database, and I think that the problem of write locks on referenced
rows is a serios drawback in performance, usability and prestige of
PosеgreSQL.

My database is not under heavy load, usually there are several
read-only clients with low activity, most of the time only one client
which inserts new data into only one table, and sometimes it's
activity coincides with activity of second client, which updates
several other tables.  And these two client occasionally deadlock each
other because of foreign keys.

The purpose of my posting is to point at importance of this problem to
all PostgreSQL community.

Timur.