Re: WAL-files restore and nextval('PK')

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andreas Gaab <A(dot)Gaab(at)scanlab(dot)de>
Cc: pgsql-sql mailing list <pgsql-sql(at)postgresql(dot)org>, Hans Joachim Münzer <H(dot)Muenzer(at)scanlab(dot)de>
Subject: Re: WAL-files restore and nextval('PK')
Date: 2010-05-03 15:28:47
Message-ID: 20100503152847.GC2986@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Andreas Gaab wrote:
> Dear all,
>
> after an WAL-restore of our Postgres DB, we observe seemingly wrong values of our sequences.

This is normal. The reason is that sequences are WAL-logged in chunks,
not single values (otherwise they'd be too slow). So after recovery,
the values jump to the logged values, which are necessarily higher than
the values they last delivered before the crash.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message silly sad 2010-05-04 12:05:09 Re: [GENERAL] Schema design / joins
Previous Message Tom Lane 2010-05-03 13:33:21 Re: WAL-files restore and nextval('PK')