is it safe to clear oroginal xlog after archiving it?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: is it safe to clear oroginal xlog after archiving it?
Date: 2009-06-04 12:42:21
Message-ID: 20090604124220.GA31943@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi,
i have archive_command which copies the wal segment someplace.

is it safe, if i would do:
dd if=/dev/zero of=$ORIGINAL_XLOG_SEGMENT bs=1M count=16
before returning from archive_command script?

the point of doing so is pretty simple: i have a system with rather low
traffic, so i use archive_timeout. and most of the xlog segments are
unused, but they contain previous data, since the files are reused.

if zero-ing the files was safe, i could compress them more effectively.

i am aware that there is pg_lesslog or clearxlogtail, but if this
zeroing would be ok, then i'd rather use it (one less program to worry
about, and it looks safer because i modify file that will be overwritten
anyway).

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
jid/gtalk: depesz(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-06-04 12:49:20 Re: Upgrading Database: need to dump and restore?
Previous Message William Temperley 2009-06-04 12:35:17 Re: High I/O writes activity on disks causing images on browser to lag and not load