Re: BUG #2290: Incorrect sequence increment after backup/restore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oleg Mamontov" <oleg(at)mamontov(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2290: Incorrect sequence increment after backup/restore
Date: 2006-02-28 15:57:46
Message-ID: 15341.1141142266@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Oleg Mamontov" <oleg(at)mamontov(dot)net> writes:
> If after CREATE TABLE with SERIAL column i'll change sequence increment to 2
> or some other value (with ALTER SEQUENCE) then always work correctly (all
> inserted rows will have values incremented by 2).

We currently consider that a serial column is a "black box" and you
should not mess with its underlying sequence directly. If you want
nondefault properties for the sequence, create it as an independent
sequence object and then just declare the column as "integer
default nextval('seq')".

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tim Kordas 2006-02-28 18:25:10 BUG #2291: int2vectorrecv() and oidvectorrecv() are wrong (SIGBUS)
Previous Message Michael Fuhr 2006-02-28 15:39:52 Re: BUG #2289: insert into tables not working