Re: Could be improved point of UPSERT

Поиск
Список
Период
Сортировка
От Gianni
Тема Re: Could be improved point of UPSERT
Дата
Msg-id 1824141.b0BH7puxM7@tux
обсуждение исходный текст
Ответ на Re: Could be improved point of UPSERT  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Could be improved point of UPSERT  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers
On Tuesday 14 July 2015 11:33:34 Peter Geoghegan wrote:
> On Sun, Jul 12, 2015 at 4:09 AM, Yourfriend <doudou586@gmail.com> wrote:
> > Suggestion:  When a conflict was found for UPSERT, don't access the
> > sequence, so users can have a reasonable list of ID.
> 
> This is not technically feasible. What if the arbiter index is a serial PK?
> 
> The same thing can happen when a transaction is aborted. SERIAL is not
> guaranteed to be gapless.

Could there be a version of UPSERT where an update is tried, and if 0 records 
are modified, an insert is done?

Just wondering, I haven't got am use-case for that.  I don't mid gaps in 
sequences.



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Could be improved point of UPSERT
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Bug in bttext_abbrev_convert()