pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Johnston <polobo@yahoo.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #8582: field serial getted incorrect value from automaticaly created its sequence
Date: Thu, 7 Nov 2013 11:16:51 -0800 (PST)
Message-ID: <1383851811735-5777396.post@n5.nabble.com> (raw)
In-Reply-To: <527BE237.6040701@hogranch.com>
References: <E1VeK8A-0006V4-EX@wrigleys.postgresql.org>
	<6157.1383849678@sss.pgh.pa.us>
	<527BE237.6040701@hogranch.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

John R Pierce wrote
> On 11/7/2013 10:41 AM, Tom Lane wrote:
>> 

> evgeniy.skomorokhov@

>   writes:
>>> >Automaticaly created sequence takes values ​​from the range [1;
>>> >9223372036854775807] but max value of field which will be filled from
>>> >sequence - max of type integer (2147483647).
>> If you want a bigint column, use "bigserial".  Not everybody wants
>> to take that space penalty, though.
> 
> 
> I think he's suggesting that a sequence generated from a regular serial 
> probably shouldn't have that 63 bit max_value

The main advantage of the current behavior is if you hit the limit for an
integer you can alter the column type to bigint without having to mess
around with the associated sequence.  If the sequence was upper-bound
limited that same conditions that caused the out-of-range error will just
generate a different kind of error (not sure which one if the sequence is
exhausted).

Its definitely not a "bug" whether you believe the behavior should be
changed or not.  A sequence is de-coupled from any particular type.  Maybe
if there were short, normal, and big sequences with matching performance
improvements it would matter but having only a single sequence
implementation makes the current behavior/defaults reasonable for normal
usage.

I am curious why this even came up.  This seems to be the kind of thing most
people would be oblivious to.

David J.








--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-8582-field-serial-getted-incorrect-value-from-automatica...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


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

Message-ID: <1383851811735-5777396.post@n5.nabble.com>
Permalink:  ../1383851811735-5777396.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1383851811735-5777396.post@n5.nabble.com

 · 

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: polobo@yahoo.com
  Subject: Re: BUG #8582: field serial getted incorrect value from automaticaly created its sequence
  In-Reply-To: <1383851811735-5777396.post@n5.nabble.com>
  References: <E1VeK8A-0006V4-EX@wrigleys.postgresql.org> <6157.1383849678@sss.pgh.pa.us> <527BE237.6040701@hogranch.com> <1383851811735-5777396.post@n5.nabble.com>

* 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