Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8F63163402B for ; Mon, 3 May 2010 12:28:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 80143-01-7 for ; Mon, 3 May 2010 15:28:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 7A73963395B for ; Mon, 3 May 2010 12:28:52 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id A739B348038; Mon, 3 May 2010 08:28:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SqO5ectKpfCL; Mon, 3 May 2010 08:28:49 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [190.95.8.51]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 4DCB8348037; Mon, 3 May 2010 08:28:49 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 545A96E355; Mon, 3 May 2010 11:28:47 -0400 (CLT) Date: Mon, 3 May 2010 11:28:47 -0400 From: Alvaro Herrera To: Andreas Gaab Cc: pgsql-sql mailing list , Hans Joachim =?iso-8859-1?Q?M=FCnzer?= Subject: Re: WAL-files restore and nextval('PK') Message-ID: <20100503152847.GC2986@alvh.no-ip.org> References: <48DA836F3865C54B8FBF424A3B775AF6010D455863@Exchange-Server> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48DA836F3865C54B8FBF424A3B775AF6010D455863@Exchange-Server> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.708 tagged_above=-5 required=5 tests=AWL=0.192, BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201005/11 X-Sequence-Number: 34059 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.