Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1az3pv-0001fH-MH for pgsql-bugs@arkaria.postgresql.org; Sat, 07 May 2016 15:08:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1az3pu-0006Vd-EW for pgsql-bugs@arkaria.postgresql.org; Sat, 07 May 2016 15:08:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1az3pH-0005ok-Nh for pgsql-bugs@postgresql.org; Sat, 07 May 2016 15:07:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1az3pA-0000d8-PB for pgsql-bugs@postgresql.org; Sat, 07 May 2016 15:07:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u47F7BNf002187; Sat, 7 May 2016 11:07:11 -0400 From: Tom Lane To: Francisco Olarte cc: Andres Freund , Peter Geoghegan , Casey Wireman , "pgsql-bugs@postgresql.org" Subject: Re: BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens. In-reply-to: References: <20160506065528.2693.64808@wrigleys.postgresql.org> <20160506182040.6bbpacq3ncj777ic@alap3.anarazel.de> Comments: In-reply-to Francisco Olarte message dated "Sat, 07 May 2016 12:05:33 +0200" Date: Sat, 07 May 2016 11:07:11 -0400 Message-ID: <2186.1462633631@sss.pgh.pa.us> X-Pg-Spam-Score: -4.0 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Francisco Olarte 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