Locking row

From: Flavio Suguimoto <flavio(dot)suguimoto(at)pragyatechnologies(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Locking row
Date: 2006-03-10 20:50:10
Message-ID: GFEGIFLJJCMGLBLAHILKEEDECGAA.flavio.suguimoto@pragyatechnologies.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all,

I need to mark a row with a value in a column, but first i need to select
the first row without this mark. But in some concurrents cases i mark the
row twice. How can i lock the row to avoid others session get it?

TABLE TICKET
TICKET_NUMBER | MARK
00001 | 1
00002 | 0

I need to select the first row with 0 in MARK column and then mark it with
1.

regards,
Flavio Suguimoto

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Larry Rosenman 2006-03-10 20:57:51 Re: Locking row
Previous Message Bruno Wolff III 2006-03-10 17:31:13 Re: How can I selet rows which have 2 columns values cross equal?