RE: How to get a self-conflicting row level lock?

From: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
To: "'Forest Wilkinson'" <fspam(at)home(dot)com>, pgsql-sql(at)hub(dot)org
Subject: RE: How to get a self-conflicting row level lock?
Date: 2000-07-08 02:03:10
Message-ID: 8F4C99C66D04D4118F580090272A7A23018C4A@SECTORBASE1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Is it true that SELECT ... FOR UPDATE only acquires a ROW
> SHARE MODE lock, and that it isn't self-conflicting?

SELECT FOR UPDATE acquires ROW SHARE LOCK on *table* level.
But rows returned by SELECT FOR UPDATE is locked *exclusively*
- so any other transaction which tries to mark the same row
for update (or delete/update it) will be blocked... and will
return *updated* row version after 1st transaction committed.

Vadim

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-07-08 02:18:53 Re: Re: [SQL] Re: [GENERAL] lztext and compression ratios...
Previous Message Philip Warner 2000-07-08 02:00:31 Re: Re: [SQL] Re: [GENERAL] lztext and compression ratios...