Re: Need to select and update with the same sql statement

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Need to select and update with the same sql statement
Дата
Msg-id 20021114134514.GA20110@wolff.to
обсуждение исходный текст
Ответ на Re: Need to select and update with the same sql statement  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-php
On Wed, Nov 13, 2002 at 15:26:42 -0700,
  "scott.marlowe" <scott.marlowe@ihs.com> wrote:
>
> Oh, I just thought of the better way than locking the whole table is to
> use a "select for update" on the row you want to lock.  I think that'll do
> what you want and without locking the whole table.  Of course, 20 lines of
> PHP code runs pretty fast, so unless you're handling lotsa traffic locking
> the table probably works fine too.

This came up in a discussion recently and it really isn't better. If you
do this you have to worry about the select for update returning zero
rows (even with the limit 1 clause) and retry the query if it does.

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

Предыдущее
От: "Phil Geer"
Дата:
Сообщение: Re: serial type question
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: serial type question