Re: SIREAD lock versus ACCESS EXCLUSIVE lock
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>, pgsql-hackers@postgresql.org, "<Simon Riggs" <simon@2ndquadrant.com>, Dan Ports <drkp@csail.mit.edu>
Date: 2011-06-04T16:20:52Z
Lists: pgsql-hackers
On 04.06.2011 19:19, Tom Lane wrote: > Heikki Linnakangas<heikki.linnakangas@enterprisedb.com> writes: >> On 03.06.2011 21:04, Kevin Grittner wrote: >>> Also, if anyone has comments or hints about the placement of those >>> calls, I'd be happy to receive them. > >> heap_drop_with_catalog() schedules the relation for deletion at the end >> of transaction, but it's still possible that the transaction aborts and >> the heap doesn't get dropped after all. If you put the >> DropAllPredicateLocksFromTable() call there, and the transaction later >> aborts, you've lost all the locks already. > > But on the third thought: is that wrong? Surely locks taken by an > aborted transaction can be discarded. These are predicate locks - there can be "locks" on the table belonging to transactions that have already committed. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com