Обсуждение: BUG #8718: serial datatype creates a sequence with bigserial limits

Поиск
Список
Период
Сортировка

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

От
richcocoa@gmail.com
Дата:
The following bug has been logged on the website:

Bug reference:      8718
Logged by:          Richard Savio
Email address:      richcocoa@gmail.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.

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

От
David Johnston
Дата:
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.