Re: FOR SHARE vs FOR UPDATE locks
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Heikki Linnakangas" <heikki@enterprisedb.com>
Cc: "Alvaro Herrera" <alvherre@commandprompt.com>, "Simon Riggs" <simon@2ndquadrant.com>, pgsql-hackers@postgreSQL.org
Date: 2006-12-01T17:40:46Z
Lists: pgsql-hackers, pgsql-docs
Actually ... wait a minute. The proposed hack covers the case of SELECT FOR SHARE followed by SELECT FOR UPDATE within a subtransaction. But what about SELECT FOR SHARE followed by an actual UPDATE (or DELETE)? We certainly don't want to mark the UPDATE/DELETE as having been carried out by the upper transaction, but there's no way we can record the UPDATE while still remembering the previous share-lock. So I think I'm back to the position that we should throw an error here. regards, tom lane