Re: 9.0.4/7 WAL Archiving: archive_command add date-time to cp of filename

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jeff L'Huillier" <Jeff(dot)LHuillier(at)ONSTAR(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: 9.0.4/7 WAL Archiving: archive_command add date-time to cp of filename
Date: 2012-04-11 14:09:17
Message-ID: 4F854A3D0200002500046DC2@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"L'Huillier, Jeff" <Jeff(dot)LHuillier(at)ONSTAR(dot)com> wrote:

> When enabling WAL archiving and setting up the archive_command, is
> it possible to add the date & time as an extension to the %f
> copied to the archive directory in order to avoid overwriting a
> file of the same name?

The recommended behavior is to exit the recovery command (or the
script run as the command) with an exit code of 255 when the target
file already exists. This should never happen unless you
accidentally point two different database clusters to the same
target directory.

> In adding a date-time stamp to the archived file name, would this
> adversely affect the restore_command and render the %f file coming
> back unusable?

Well, you could use a wildcard in the restore command to find a
matching file, but if there is more than one because of the
timestamps added to the filename, which one do you pick?

-Kevin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message L'Huillier, Jeff 2012-04-11 15:29:14 Re: 9.0.4/7 WAL Archiving: archive_command add date-time to cp of filename
Previous Message Tom Lane 2012-04-11 14:08:41 Re: 9.0.4/7 WAL Archiving: archive_command add date-time to cp of filename