Re: BUG #9366: Default MAXVALUE is incorrect for sequence object of serial type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kashi(at)fhpg(dot)net
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #9366: Default MAXVALUE is incorrect for sequence object of serial type
Date: 2014-02-27 07:02:43
Message-ID: 19374.1393484563@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

kashi(at)fhpg(dot)net writes:
> When I create the new table as serial type column , I found a strange
> condition on sequence parameter.
> It could be specified as integer, but MAXVALUE of sequence is set as
> Bigint.

This is not a bug, but intentional behavior. See
http://www.postgresql.org/message-id/flat/E1VeK8A-0006V4-EX(at)wrigleys(dot)postgresql(dot)org#E1VeK8A-0006V4-EX@wrigleys.postgresql.org

> At that case, MAXVALUE of test_int_seq_int_seq is "9223372036854775807". As
> the result, if the current value is 2147483647, next insert operation could
> be failed as "ERROR: integer out of range".

So? If we set the sequence limit differently, the case would still fail,
just with a different error message. And you'd then have two things to
fix, not only one, to get your database back in working order.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Rainer Tammer 2014-02-27 07:21:51 Re: Problem with PostgreSQL 9.2.7 and make check on AIX 7.1
Previous Message kashi 2014-02-27 03:45:10 BUG #9366: Default MAXVALUE is incorrect for sequence object of serial type