Re: Bug: Sequence generator insert

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Bug: Sequence generator insert
Дата
Msg-id 20031128213828.GA24904@wolff.to
обсуждение исходный текст
Ответ на Bug: Sequence generator insert  ("Burr, Colin" <CBurr@herald.com>)
Список pgsql-sql
On Tue, Nov 25, 2003 at 18:37:41 -0500, "Burr, Colin" <CBurr@herald.com> wrote:
> 
> However, even though the new record failed to be inserted into the table,
> the sequence generator was still updated.
> 
> The sequence generator should only be updated if the record is successfully
> inserted into the table, and should not be updated if the insert fails.

That isn't how sequences work. If you need a sequence of numbers without
gaps then you need to use something else. Note that the something else
will need to have a way to let only one transaction at a time update
the counter which may be a performance problem.


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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: rules and return values question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: explicit joins wrong planning