BUG #8718: serial datatype creates a sequence with bigserial limits

Lists: pgsql-bugs
From: richcocoa(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #8718: serial datatype creates a sequence with bigserial limits
Date: 2014-01-03 12:33:11
Message-ID: E1Vz3w7-0001Eh-BD@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 8718
Logged by: Richard Savio
Email address: richcocoa(at)gmail(dot)com
PostgreSQL version: 9.3.2
Operating system: Arch Linux 3.12.16 Linux kernel
Description:

If you create a column with serial data type, it is created as an INTEGER
field but the sequence used to auto-increment the field has a limit only
suitable for BIGINT, so it may result in out of range errors.


From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8718: serial datatype creates a sequence with bigserial limits
Date: 2014-01-03 21:25:49
Message-ID: 1388784349415-5785272.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

richcocoa wrote
> The following bug has been logged on the website:
>
> Bug reference: 8718
> Logged by: Richard Savio
> Email address:

> richcocoa@

> PostgreSQL version: 9.3.2
> Operating system: Arch Linux 3.12.16 Linux kernel
> Description:
>
> If you create a column with serial data type, it is created as an INTEGER
> field but the sequence used to auto-increment the field has a limit only
> suitable for BIGINT, so it may result in out of range errors.

Yes, it does. This is by design. You can either get a "sequence out of
range" error or an "integer overflow error" if you run against the limit.
At least this way you can alter the type to be a bigint without having to
worry about messing with the sequence.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-8718-serial-datatype-creates-a-sequence-with-bigserial-limits-tp5785224p5785272.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.