pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #9366: Default MAXVALUE is incorrect for sequence object of serial type
2+ messages / 2 participants
[nested] [flat]

* BUG #9366: Default MAXVALUE is incorrect for sequence object of serial type
@ 2014-02-27 03:45  kashi@fhpg.net
  0 siblings, 1 reply; 2+ messages in thread

From: kashi@fhpg.net @ 2014-02-27 03:45 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      9366
Logged by:          KASHI, Yukihito
Email address:      kashi@fhpg.net
PostgreSQL version: 9.1.6
Operating system:   Windows7 / Linux version 2.6.18
Description:        

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.

ex)
CREATE TABLE test_int (seq_int serial, test_int integer);
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".

I briefly check the release note, but I couldn't find any changes related
with serial between 9.1.7 - 9.1.12.

Thank you.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #9366: Default MAXVALUE is incorrect for sequence object of serial type
@ 2014-02-27 07:02  Tom Lane <tgl@sss.pgh.pa.us>
  parent: kashi@fhpg.net
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2014-02-27 07:02 UTC (permalink / raw)
  To: kashi@fhpg.net; +Cc: pgsql-bugs

kashi@fhpg.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@wrigleys.postgresql.org#E1VeK8A-0006V4-E...

> 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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2014-02-27 07:02 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-02-27 03:45 BUG #9366: Default MAXVALUE is incorrect for sequence object of serial type kashi@fhpg.net
2014-02-27 07:02 ` Tom Lane <tgl@sss.pgh.pa.us>

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