"Olivier Ceulemans" <Olivier.Ceulemans@xxxxxxxxxxxx> writes: > I wrote an application making 'advanced' use of transactions. The > application is not tied to a specific kind of database. It runs fine on > oracle, db2, sql server but I run into a deadlock on postgresql. > ... > For transaction A, I have a RowShareLock on table X. I have no idea on > how/why this RowShareLock is acquired by my application. In transaction > A, I never read/write 'directly' to the table X. However I create data > in other tables that have foreign keys to table X. What Postgres version is this? Before 8.1 we used exclusive row locks to enforce that referenced rows didn't go away before a referencing row could be committed, and this made it easy to hit unexpected deadlocks. regards, tom lane