Re: BUG #3668: type error in serial - Mailing list pgsql-bugs

From Dave Johansen
Subject Re: BUG #3668: type error in serial
Date
Msg-id 5a4b25cd-3398-4b5c-90a6-9788b4957bdd@googlegroups.com
Whole thread Raw
In response to Re: BUG #3668: type error in serial  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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 sh=
ould
> > also be defined as bigint.=20
>=20
> This is not a bug, primarily because we have only one size of sequence.
>=20
>             regards, tom lane
>=20
> ---------------------------(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 maxim=
um 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 "in=
teger out of range". That seems like a relatively minor change that could s=
ave people a LOT of headache.

Dave

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #6639: Manual uses boldface where it says italic, and monospace where it says boldface
Next
From: Tom Lane
Date:
Subject: Re: BUG #7510: Very bad costing estimation on gin vs gist with FTS