pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: paul@salesintel.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13846: INSERT ON CONFLICT consumes sequencers on conflicts
Date: Tue, 5 Jan 2016 17:13:26 +0100
Message-ID: <20160105161326.GD7650@awork2.anarazel.de> (raw)
In-Reply-To: <20160105150227.1117.51692@wrigleys.postgresql.org>
References: <20160105150227.1117.51692@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2016-01-05 15:02:27 +0000, paul@salesintel.com wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      13846
> Logged by:          Paul Hester
> Email address:      paul@salesintel.com
> PostgreSQL version: 9.5rc1
> Operating system:   Windows 10 Pro
> Description:        
> 
> When using an INSERT statement with an ON CONFLICT clause, if there is a
> conflict, and the table being inserted into has a column defaulted to
> nextval('seq'), the sequencer 'seq' is always incremented. This can quickly
> and artificially consume all values of the sequencer; it behaves as if
> conflict detection happens after inserts are attempted, rather than before.

Yes. That's by design. You can't reliably do conflict detection before
evaluating column default values.

Andres Freund


-- 
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 (13+ messages)  latest in thread

Message-ID: <20160105161326.GD7650@awork2.anarazel.de>
Permalink:  ../20160105161326.GD7650@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20160105161326.GD7650@awork2.anarazel.de

 · 

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: andres@anarazel.de, paul@salesintel.com
  Subject: Re: BUG #13846: INSERT ON CONFLICT consumes sequencers on conflicts
  In-Reply-To: <20160105161326.GD7650@awork2.anarazel.de>
  References: <20160105150227.1117.51692@wrigleys.postgresql.org> <20160105161326.GD7650@awork2.anarazel.de>

* 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