Re: Locking row

Поиск
Список
Период
Сортировка
От Larry Rosenman
Тема Re: Locking row
Дата
Msg-id 023e01c64485$4be7f630$0a0a0a0a@aus.pervasive.com
обсуждение исходный текст
Ответ на Locking row  (Flavio Suguimoto <flavio.suguimoto@pragyatechnologies.com>)
Ответы Re: Locking row  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-sql
Flavio Suguimoto wrote:
> 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.


look at the FOR UPDATE in the select docs.



-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 512-248-2683                 E-Mail: ler@lerctr.org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893



В списке pgsql-sql по дате отправления:

Предыдущее
От: Flavio Suguimoto
Дата:
Сообщение: Locking row
Следующее
От: Bryce Nesbitt
Дата:
Сообщение: Advice on setting up a grid like view for spreadsheet users