SELECT ... FOR UPDATE

From: Loïc Bourgeois <loic(dot)bourgeois(at)mobileway(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: SELECT ... FOR UPDATE
Date: 2001-04-05 12:29:43
Message-ID: 3ACC6537.9080200@mobileway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have to create a program to use the lastest version of PostgreSQL.
Many processes of this program must run in parallele.
In a table I have to select some specific row next insert a new row with
the same search carateristiques
and commit.

But between the select and the insert action none other proccesses
execute the same research parameters (which must return the same lines)
before the commit of the first process. Or the result of the second
select must contain the insert result of the precedent process.

I known I must use SELECT FOR UPDATE and or BEGIN section with lock table.
What is the lock option mode.

Thanks a lot for all the informations.

For resume I would like to do a SELECT ... FOR UPDATE with the option NOWAIT (cf. ORACLE instruction).

Browse pgsql-sql by date

  From Date Subject
Next Message Tim Perdue 2001-04-05 12:52:50 Re: Memory and performance
Previous Message Richard Huxton 2001-04-05 08:45:59 Re: Index on View ?