Re: WAL-files restore and nextval('PK') - Mailing list pgsql-sql

From Alvaro Herrera
Subject Re: WAL-files restore and nextval('PK')
Date
Msg-id 20100503152847.GC2986@alvh.no-ip.org
Whole thread Raw
In response to WAL-files restore and nextval('PK')  (Andreas Gaab <A.Gaab@scanlab.de>)
List 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.


pgsql-sql by date:

Previous
From: E H
Date:
Subject: [GENERAL] Schema design / joins
Next
From: silly sad
Date:
Subject: Re: [GENERAL] Schema design / joins