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

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
Thread:
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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Johnston 2014-01-04 04:26:59 Re: BUG #8721: pg_wrapper unaware of configuration includes
Previous Message Joe Conway 2014-01-03 18:45:22 Re: BUG #8710: dblink dblink_get_pkey output bug, and dblink_build_sql_update bug