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: 15341.1141142266@sss.pgh.pa.us (view raw or flat)
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

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-2014 The PostgreSQL Global Development Group