Datatype SERIAL incorrectly interpreted

Started by PostgreSQL Bugs Listabout 25 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Hubert Hafner (dogart@iname.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Datatype SERIAL incorrectly interpreted

Long Description
If you create a table with more than 1 SERIAL, only for the last a sequence is created by PostgreSQL. The other fields only set to INTEGER, but there is no sequence for.

Sample Code
CREATE TABLE Example (Field1 SERIAL, Field2 SERIAL);

PostgreSQL would generate:
Table Example:
Field1 as INTEGER NOT NULL DEFAULT nextval(Field1_Example_seq)
Field2 as INTEGER NOT NULL DEFAULT nextval(Field2_Example_seq)

But only Field2_Example_seq really exits!

No file was uploaded with this report

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Datatype SERIAL incorrectly interpreted

pgsql-bugs@postgresql.org writes:

If you create a table with more than 1 SERIAL, only for the last a
sequence is created by PostgreSQL. The other fields only set to
INTEGER, but there is no sequence for.

This is fixed in 7.1.

regards, tom lane