Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id DD57FF765A for ; Wed, 11 Apr 2012 11:09:32 -0300 (ADT) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SHyEl-0008BE-TD for pgsql-admin@postgresql.org; Wed, 11 Apr 2012 14:09:32 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 11 Apr 2012 09:09:18 -0500 Message-Id: <4F854A3D0200002500046DC2@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Wed, 11 Apr 2012 09:09:17 -0500 From: "Kevin Grittner" To: "Jeff L'Huillier" , Subject: Re: 9.0.4/7 WAL Archiving: archive_command add date-time to cp of filename References: <7CF5C5C9FE3CE140AD240A391A7681FBF5CC0F@USRN4EX0ONS06.onstar.ad.gm.com> In-Reply-To: <7CF5C5C9FE3CE140AD240A391A7681FBF5CC0F@USRN4EX0ONS06.onstar.ad.gm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201204/55 X-Sequence-Number: 39391 "L'Huillier, Jeff" 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