Re: atomic multi-threaded upsert

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: atomic multi-threaded upsert
Дата
Msg-id 21822.1290633670@sss.pgh.pa.us
обсуждение исходный текст
Ответ на atomic multi-threaded upsert  ("Mikhail V. Puzanov" <misha.puzanov@gmail.com>)
Ответы Re: atomic multi-threaded upsert
Список pgsql-sql
"Mikhail V. Puzanov" <misha.puzanov@gmail.com> writes:
>    -- increment and get the counter if exists
>   UPDATE sequences SET counter = counter + 1
>   WHERE section = 'testSection' AND name = 'testKey'
>   RETURNING counter;

Seems that what you have here is a bad manual implementation of a
sequence.  Why don't you use a real sequence object and nextval()?
        regards, tom lane


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

Предыдущее
От: Louis-David Mitterrand
Дата:
Сообщение: Re: "compressing" consecutive values into one
Следующее
От: John Fabiani
Дата:
Сообщение: insert from a select