Re: BUG #13584: Upsert. The sequence value is increased.

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: BUG #13584: Upsert. The sequence value is increased.
Дата
Msg-id CAM3SWZQMfR6Zfe3A0Nr4ddko8xZrijAuQQ=EcGjGeJSs2piAXA@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #13584: Upsert. The sequence value is increased.  (av.kostromin@gmail.com)
Список pgsql-bugs
On Sat, Aug 22, 2015 at 11:25 AM,  <av.kostromin@gmail.com> wrote:
> INSERT INTO t_tags_ident (tag_name, "comment")
>  VALUES ('tag1','comment1'), ('tag2','comment2'), ('tag3','comment3'),
> ('tag4','comment4')
>  ON CONFLICT (tag_name)
>  DO UPDATE SET "comment" = EXCLUDED.comment
>  RETURNING id
> there is the following problem.  The sequence value is increased by the
> quantity of updated (conflict) rows, i.e. when I insert the new row its id
> is equal to the quantity of updated rows + 1. Is it OK for upsert?

This is the expected behavior. It is not a bug.

--
Peter Geoghegan

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

Предыдущее
От: av.kostromin@gmail.com
Дата:
Сообщение: BUG #13584: Upsert. The sequence value is increased.
Следующее
От: Nick Barnes
Дата:
Сообщение: Re: BUG #13581: pg_dump omits extension versions