Re: More information on how to understand table pg_locks. - Mailing list pgsql-general

From Tom Lane
Subject Re: More information on how to understand table pg_locks.
Date
Msg-id 2880.1173801442@sss.pgh.pa.us
Whole thread Raw
In response to More information on how to understand table pg_locks.  ("Olivier Ceulemans" <Olivier.Ceulemans@irislink.com>)
List pgsql-general
"Olivier Ceulemans" <Olivier.Ceulemans@irislink.com> 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

pgsql-general by date:

Previous
From: "Dmitry Koterov"
Date:
Subject: How to disable displaying of a NOTICE context?
Next
From: Tom Lane
Date:
Subject: Re: How to disable displaying of a NOTICE context?