Re: table locking and SELECT FOR UPDATE - Mailing list pgsql-general

From Tom Lane
Subject Re: table locking and SELECT FOR UPDATE
Date
Msg-id 12667.1121122514@sss.pgh.pa.us
Whole thread Raw
In response to table locking and SELECT FOR UPDATE  (Joseph Shraibman <jks@selectacast.net>)
Responses Re: table locking and SELECT FOR UPDATE
List pgsql-general
Joseph Shraibman <jks@selectacast.net> writes:
> How come when a share lock is held and update can't be done on the
> table, but a SELECT FOR UPDATE can be done?  I can't SELECT FOR UPDATE
> the same row in two transactions, but I can SELECT FOR UPDATE a row that
> I will won't be able to update because the other table is held in a
> SHARE lock.

[ shrug... ]  Prohibiting that buys nothing that I can see, and up until
8.1 would have actively broken useful functionality (since SELECT FOR
UPDATE was the only way to lock individual rows, whether or not you had
any intention of updating them).

            regards, tom lane

pgsql-general by date:

Previous
From: "Thomas F. O'Connell"
Date:
Subject: Quoting $user as Parameter to SET
Next
From: Tom Lane
Date:
Subject: Re: Quoting $user as Parameter to SET