Re: Re: LOCK TABLE

From: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: Re: LOCK TABLE
Date: 2000-09-18 17:15:38
Message-ID: 20000918181538.K2791@quartz.newn.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Sep 17, 2000 at 12:50:26PM -0700, Stephan Szabo wrote:
>
> If you always SELECT ... FOR UPDATE (in all transactions that access it),
> then the second one will not see the DB state before the transaction is
> started, because the row is locked and the second transaction won't be
> able to get its lock and will instead wait. Admittedly this lowers your
> ability to have concurrent reads of the same rows as well, so you would
> want the other transactions to hold the lock for as short a time as
> possible.

I was wondering, if I do something like

select * from person order by surname for update limit 1 offset 10;

as there is no where clause, am I locking the whole table?

Cheers,

Patrick

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Holdren 2000-09-18 17:34:15 multiple referential integrity
Previous Message Rob Hutton 2000-09-18 14:30:02 Several questions