Re: BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens.
Дата
Msg-id 2186.1462633631@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens.  (Francisco Olarte <folarte@peoplecall.com>)
Ответы Re: BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens.  (Francisco Olarte <folarte@peoplecall.com>)
Список pgsql-bugs
Francisco Olarte <folarte@peoplecall.com> writes:
> But I've read the docs and noticed the warning:

> "Important: To avoid blocking concurrent transactions that obtain
> numbers from the same sequence, a nextval operation is never rolled
> back; that is, once a value has been fetched it is considered used,
> even if the transaction that did the nextval later aborts. This means
> that aborted transactions might leave unused "holes" in the sequence
> of assigned values."

> Which may lead people to think only rollbacks 'burn' numbers.

Yeah, good point.  I'll do some wordsmithing on that.

> 2.- IIRC using cache>1 can lead to obtain sequence numbers out of
> order is using the same sequence in two different sessions. I assumed
> this is normal and do not have a problem with it, but people may get
> surprised by it, so I think a note there could help.

I think that's explained already, no?

            regards, tom lane

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

Предыдущее
От: digoal@126.com
Дата:
Сообщение: BUG #14129: Why GIN index not use index scan?
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens.