pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Francisco Olarte <folarte@peoplecall.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: Casey Wireman <cwire4@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens.
Date: Sat, 07 May 2016 11:07:11 -0400
Message-ID: <2186.1462633631@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+bJJbzkPZHmrfcQMhVA-vRNnNP1gShffjrkjkNR9P9Y_ppq5Q@mail.gmail.com>
References: <20160506065528.2693.64808@wrigleys.postgresql.org>
	<CA+bJJbz7Gydp+DRRe_sgV1d9hP_6PtqxzLBwxCAb8DyZxYmcrQ@mail.gmail.com>
	<CAM3SWZQwcH8Ebeq1ZvKYUOSAbFfuBmc9pcF0-u5f6Az0-oHLpw@mail.gmail.com>
	<20160506182040.6bbpacq3ncj777ic@alap3.anarazel.de>
	<CA+bJJbzkPZHmrfcQMhVA-vRNnNP1gShffjrkjkNR9P9Y_ppq5Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (11+ messages)  latest in thread

Message-ID: <2186.1462633631@sss.pgh.pa.us>
Permalink:  ../2186.1462633631@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2186.1462633631@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, folarte@peoplecall.com, andres@anarazel.de, pg@heroku.com, cwire4@gmail.com
  Subject: Re: BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens.
  In-Reply-To: <2186.1462633631@sss.pgh.pa.us>
  References: <20160506065528.2693.64808@wrigleys.postgresql.org> <CA+bJJbz7Gydp+DRRe_sgV1d9hP_6PtqxzLBwxCAb8DyZxYmcrQ@mail.gmail.com> <CAM3SWZQwcH8Ebeq1ZvKYUOSAbFfuBmc9pcF0-u5f6Az0-oHLpw@mail.gmail.com> <20160506182040.6bbpacq3ncj777ic@alap3.anarazel.de> <CA+bJJbzkPZHmrfcQMhVA-vRNnNP1gShffjrkjkNR9P9Y_ppq5Q@mail.gmail.com> <2186.1462633631@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox