truncate transaction log

Started by Sergei Shelukhinover 18 years ago4 messagesgeneral
Jump to latest
#1Sergei Shelukhin
realgeek@gmail.com

Hi.

Is there any way to truncate WAL log in postgres?
We want to use full-backup strategy where we stop the server and copy
the data directory, however WAL log is taking dozens gigabytes of
spaces.
Is there any way to remove it while keeping the database operational/
restore-able by copying it back?

#2Scott Marlowe
scott.marlowe@gmail.com
In reply to: Sergei Shelukhin (#1)
Re: truncate transaction log

On 8/5/07, Sergei Shelukhin <realgeek@gmail.com> wrote:

Hi.

Is there any way to truncate WAL log in postgres?
We want to use full-backup strategy where we stop the server and copy
the data directory, however WAL log is taking dozens gigabytes of
spaces.
Is there any way to remove it while keeping the database operational/
restore-able by copying it back?

This sounds unusually high. What non-default settings are there in
your postgresql.conf file? Are you using PITR or something like that?

#3Simon Riggs
simon@2ndQuadrant.com
In reply to: Sergei Shelukhin (#1)
Re: truncate transaction log

On Sun, 2007-08-05 at 03:45 -0700, Sergei Shelukhin wrote:

Is there any way to truncate WAL log in postgres?
We want to use full-backup strategy where we stop the server and copy
the data directory, however WAL log is taking dozens gigabytes of
spaces.
Is there any way to remove it while keeping the database operational/
restore-able by copying it back?

Reduce the setting of checkpoint_segments to something more realistic.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

#4Sergei Shelukhin
realgeek@gmail.com
In reply to: Simon Riggs (#3)
Re: truncate transaction log

On Aug 7, 9:57 pm, si...@2ndquadrant.com ("Simon Riggs") wrote:

On Sun, 2007-08-05 at 03:45 -0700, Sergei Shelukhin wrote:

Is there any way to truncate WAL log in postgres?
We want to use full-backup strategy where we stop the server and copy
the data directory, however WAL log is taking dozens gigabytes of
spaces.
Is there any way to remove it while keeping the database operational/
restore-able by copying it back?

Reduce the setting of checkpoint_segments to something more realistic.

Hmm. Reduced to 60, during the db conversion from MySQL Postgres used
to complain about this setting so I increased it to the sky. Thanks :)