pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Johansen <davejohansen@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #3668: type error in serial
Date: Wed, 29 Aug 2012 16:38:27 -0700 (PDT)
Message-ID: <5a4b25cd-3398-4b5c-90a6-9788b4957bdd@googlegroups.com> (raw)
In-Reply-To: <24664.1192051937@sss.pgh.pa.us>
References: <200710101902.l9AJ2Lbn080555@wwwmaster.postgresql.org>
	<24664.1192051937@sss.pgh.pa.us>

On Wednesday, October 10, 2007 2:32:17 PM UTC-7, Tom Lane wrote:
> "Eric Weimer" <eweimer@thelocalphonecompany.net> writes:
> > Creating a table with a column of type serial causes the creation of a
> > sequence tied as the default value for the column.
> > The actual type of the column is integer, however the sequence created is of
> > type bigint. If the sequence is created as a bigint, then the column should
> > also be defined as bigint. 
> 
> This is not a bug, primarily because we have only one size of sequence.
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

I believe that the SERIAL type should set the MAXVALUE appropriately (that of a 32 bit number) because then it could give an error like "reached maximum value of sequence" rather than having people beating their heads against the wall because they can't figure out why they're getting an error of "integer out of range". That seems like a relatively minor change that could save people a LOT of headache.

Dave




view thread (3+ messages)

Message-ID: <5a4b25cd-3398-4b5c-90a6-9788b4957bdd@googlegroups.com>
Permalink:  ../5a4b25cd-3398-4b5c-90a6-9788b4957bdd@googlegroups.com/
Also on:    postgresql.org/message-id/5a4b25cd-3398-4b5c-90a6-9788b4957bdd@googlegroups.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: davejohansen@gmail.com
  Subject: Re: BUG #3668: type error in serial
  In-Reply-To: <5a4b25cd-3398-4b5c-90a6-9788b4957bdd@googlegroups.com>
  References: <200710101902.l9AJ2Lbn080555@wwwmaster.postgresql.org> <24664.1192051937@sss.pgh.pa.us> <5a4b25cd-3398-4b5c-90a6-9788b4957bdd@googlegroups.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