Re: Tests with switch of WAL segment files.

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "J(dot) Carlos Muro" <murojc(at)gmail(dot)com>, "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Tests with switch of WAL segment files.
Date: 2009-07-17 15:18:31
Message-ID: 4A604FF7020000250002890D@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"J. Carlos Muro" <murojc(at)gmail(dot)com> wrote:

>> Hi! I am trying to better understand when switch of WAL files takes
>> place.

I believe that it happens when the file is full, when pg_xlog_switch
is run (if there has been anything written to the current WAL file).
I think, at least in some version, a switch is also forced at certain
points in the shutdown or recovery phases. Some of the examples you
showed didn't switch files when you expected because you were running
statements which bypass WAL logging. (In particular, inserting rows
into a table in the same transaction in which the table is created,
when archiving is off, doesn't require WAL logging -- if the
transaction rolls back the table will be gone anyway.)

I hope this helps.

-Kevin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Anj Adu 2009-07-17 18:53:01 migrating from 8.1.x to 8.4
Previous Message Gergely CZUCZY 2009-07-17 14:59:42 pgsnmpd