Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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


pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group