RE: How to get a self-conflicting row level lock? - Mailing list pgsql-sql

From Mikheev, Vadim
Subject RE: How to get a self-conflicting row level lock?
Date
Msg-id 8F4C99C66D04D4118F580090272A7A23018C4A@SECTORBASE1
Whole thread Raw
In response to How to get a self-conflicting row level lock?  (Forest Wilkinson <fspam@home.com>)
List 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


pgsql-sql by date:

Previous
From: "Tony Nakamura"
Date:
Subject: Supported Encoding
Next
From: "Jean-Marc Libs"
Date:
Subject: SERIAL type does not generate new ID ?