Re: lock row in table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: lock row in table
Дата
Msg-id 10885.1062077913@sss.pgh.pa.us
обсуждение исходный текст
Ответ на lock row in table  (Daniel Michał <danielosch@o2.pl>)
Список pgsql-sql
Daniel Michał <danielosch@o2.pl> writes:
> I have to lock one row in table1 for user1. In the same time other users sh=
> ould be able to read this record but when other user for example user2 want=
>  to edit this record  user2 should get information "The row you try to edit=
>  is currently edit" - or sometihing similar.

> Of course I can lock record with syntax "Begin; select * from table1 where =
> ID=3D12 for update; update table1 set field1=3D"New value" where ID=3D12; c=
> ommit;"
> but I can not to inform other user that the record is edited?

Try using the contrib/userlock/ functions.
        regards, tom lane


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

Предыдущее
От: "Daniel"
Дата:
Сообщение: Re: lock row in table
Следующее
От: "Brett Dikeman"
Дата:
Сообщение: interval conversion