Re: Could be improved point of UPSERT

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Yourfriend <doudou586(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Could be improved point of UPSERT
Date: 2015-07-14 18:33:34
Message-ID: CAM3SWZR3o9Xy_PrqMHWiZPo_QvcBa9S+MT-eM7A+d=TiQp1CVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jul 12, 2015 at 4:09 AM, Yourfriend <doudou586(at)gmail(dot)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.
--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gianni 2015-07-14 18:40:59 Re: Could be improved point of UPSERT
Previous Message Alvaro Herrera 2015-07-14 18:30:17 Re: git push hook to check for outdated timestamps