BUG #8582: field serial getted incorrect value from automaticaly created its sequence - Mailing list pgsql-bugs

From evgeniy.skomorokhov@gmail.com
Subject BUG #8582: field serial getted incorrect value from automaticaly created its sequence
Date
Msg-id E1VeK8A-0006V4-EX@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #8582: field serial getted incorrect value from automaticaly created its sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8582
Logged by:          Evgeniy Skomorokhov
Email address:      evgeniy.skomorokhov@gmail.com
PostgreSQL version: 9.2.4
Operating system:   ubuntu precise 12.04
Description:

Automaticaly created sequence takes values ​​from the range [1;
9223372036854775807] but max value of field which will be filled from
sequence - max of type integer (2147483647).


In PostgreSQL we can set field type "serial" during creting table like:
CREATE TABLE test1(
id serial
);


Then we get table and sequence structure like
/*
NOTICE:  CREATE TABLE will create implicit sequence "test1_id_seq" for
serial column "test1.id"


-- Created structures test1 and test1_id_seq:


CREATE TABLE test1
(
  id serial NOT NULL
)
WITH (
  OIDS=FALSE
);
ALTER TABLE test1
  OWNER TO gis;




CREATE SEQUENCE test1_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;
ALTER TABLE test1_id_seq
  OWNER TO gis;
*/


And when we insert values to table we can get exception "ERROR: integer out
of range"

pgsql-bugs by date:

Previous
From: peeyush.singla@gmail.com
Date:
Subject: BUG #8581: PG::UndefinedObject: ERROR: type "json" does not exist
Next
From: Francisco Olarte
Date:
Subject: Re: BUG #8583: I can't install this product