Re: Issues with upserts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Issues with upserts
Дата
Msg-id 2230612.1657724780@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RE: Issues with upserts  (André Hänsel <andre@webkr.de>)
Список pgsql-general
=?utf-8?Q?Andr=C3=A9_H=C3=A4nsel?= <andre@webkr.de> writes:
> This will yield “8”, showing that new sequence numbers have been generated for each attempt.

Well, yeah, because the INSERT has to be attempted first, and
that includes forming the whole candidate row including the
nextval() result.  If you're expecting a serial ID column to not
have holes in the sequence of values, you're going to be sadly
disappointed, whether you use ON CONFLICT UPDATE or not.

            regards, tom lane



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

Предыдущее
От: André Hänsel
Дата:
Сообщение: RE: Issues with upserts
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Issues with upserts