Re: After ~Crash Sequence not correct - Mailing list pgsql-bugs

From Mikheev, Vadim
Subject Re: After ~Crash Sequence not correct
Date
Msg-id 3705826352029646A3E91C53F7189E32518454@sectorbase2.sectorbase.com
Whole thread Raw
In response to After ~Crash Sequence not correct  ("Henshall, Stuart - WCP" <SHenshall@westcountrypublications.co.uk>)
Responses Re: After ~Crash Sequence not correct  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-bugs
> I have verified that killing the postmaster after a few nextval's
> leaves things in a bad state after restart.
>
> I think I see the problem: in nextval(), the sequence data written to
> the WAL log is different from that written to the data page.  Isn't
> that bogus?

It was made to avoid WAL-loging on each nextval call, ie it should work
like OID pre-fetching: value stored in WAL must always "exceed" values
returned by nextval so on the after-crash-restart sequence should be
advanced to value which was never returned by nextval (for non-cycled
sequences). Maybe I made some mistakes in implementation?

Vadim

pgsql-bugs by date:

Previous
From: "Henshall, Stuart - WCP"
Date:
Subject: Re: After ~Crash Sequence not correct
Next
From: "Gerrit van Wingerden"
Date:
Subject: failure to throw java.sql.Exception for referential integrity violation caused by PL/pgSQL stored procedure