Guillaume Smet wrote:
> On Wed, Apr 8, 2009 at 9:11 PM, I wrote:
>> Following the discussion here
>> http://archives.postgresql.org/message-id/49D9E986.8010604@pse-consulting.de
>> , I wrote a small patch which rotates the last XLog file on shutdown
>> [snip]
>
> Any comment or advice on how I can fix it with a different method if
> this one is considered wrong?
>
> Original message and patch here:
> http://archives.postgresql.org/message-id/1d4e0c10904081211p2c0f1cdepe620c11d1271ceb2@mail.gmail.com
Sorry for the delay.
It's not safe to write WAL after the checkpoint, as RequestXLogSwitch()
does. After restart, the system will start inserting WAL from the
checkpoint redo point, which is just before the XLOG_SWITCH record, and
will overwrite it.
It would be nice to have all WAL archived at shutdown, but this is not
the way to do it :-(.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com