Re: archive folder housekeeping

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "ascot(dot)moss(at)gmail(dot)com *EXTERN*" <ascot(dot)moss(at)gmail(dot)com>, PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: archive folder housekeeping
Date: 2013-08-09 09:52:20
Message-ID: A737B7A37273E048B164557ADEF4A58B17BF737C@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

ascot(dot)moss(at)gmail(dot)com wrote:
> I have enabled archive in PG (v 9.2.4):
>
> archive_mode = on
> archive_command = 'test ! -f /usr/local/pgsql/data/archive/%f && cp %p
> /usr/local/pgsql/data/archive/%f'
>
> I know that pg_xlog folder is maintained by PostgreSQL automatically, when the pg_xlog folder hits to
> certain limit (pg_xlog is full), it will automatically archive old log files into the archive folder.
> Is the parameter wal_keep_segments used to control this limit?

WAL files will be archived immediately after the switch to
the next WAL file.

pg_xlog is cleaned up, but that has nothing to do with how
full it is. It is controlled by wal_keep_segments.
WAL files are not always cleaned up immediately when they
qualify, cleanup may lag behind a little.

> On the other hand, will PostgreSQL also automatically maintain the archive folder by itself or I need
> to do some housekeeping job to maintain it from time to time? Is there any PG manual command
> available to remove archived files by (archive) date/time?
>
> Can you please advise?

PostgreSQL will not maintain the archives.
You have to do housekeeping yourself.
PostgreSQL does not know about your backup strategy
(archived WAL files should not just be deleted, but backed up).

Yours,
Laurenz Albe

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message wd 2013-08-09 10:40:04 Re: Recovery.conf and PITR
Previous Message ascot.moss@gmail.com 2013-08-09 09:38:01 archive folder housekeeping

Browse pgsql-general by date

  From Date Subject
Next Message Don Parris 2013-08-09 09:57:38 Re: How To Install Extension Via Script File?
Previous Message Raymond O'Donnell 2013-08-09 09:39:18 Re: How to contact Planet PostgreSQL