Re: table locking and SELECT FOR UPDATE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joseph Shraibman <jks(at)selectacast(dot)net>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: table locking and SELECT FOR UPDATE
Date: 2005-07-11 22:55:14
Message-ID: 12667.1121122514@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joseph Shraibman <jks(at)selectacast(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-07-11 23:04:40 Re: Quoting $user as Parameter to SET
Previous Message Thomas F. O'Connell 2005-07-11 22:16:12 Quoting $user as Parameter to SET