Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5077B6504BB; Mon, 28 Jul 2008 13:17:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 76948-01-5; Mon, 28 Jul 2008 13:17:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from alexis.jtlnet.com (alexis.jtlnet.com [69.36.9.81]) by postgresql.org (Postfix) with ESMTP id 2CE276503C6; Mon, 28 Jul 2008 13:06:38 -0300 (ADT) Received: from [192.168.10.103] (cpe-075-177-154-079.nc.res.rr.com [::ffff:75.177.154.79]) (TLS: TLSv1/SSLv3,256bits,AES256-SHA) by alexis.jtlnet.com with esmtp; Mon, 28 Jul 2008 11:59:56 -0400 id 0008BBDB.488DECFD.000065C2 Message-ID: <488DEE79.4010004@dunslane.net> Date: Mon, 28 Jul 2008 12:06:17 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20071019 Fedora/1.0.9-3.fc6 pango-text SeaMonkey/1.0.9 MIME-Version: 1.0 To: Greg Smith CC: Kevin Grittner , Simon Riggs , Heikki Linnakangas , Bruce Momjian , Dave Page , PostgreSQL-development , List pgsql-patches , Martin Zaun Subject: Re: [PATCHES] odd output in restore mode References: <200807011520.m61FKhZ20311@momjian.us> <48867904.9090001@sun.com> <1216810783.3894.602.camel@ebony.2ndQuadrant> <48877AC0.7070603@enterprisedb.com> <48873C7E.EE98.0025.0@wicourts.gov> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/1302 X-Sequence-Number: 121562 Greg Smith wrote: > On Wed, 23 Jul 2008, Kevin Grittner wrote: > >> In our scripts we handle this by copying to a temp directory on the >> same mount point as the archive directory and doing a mv to the >> archive location when the copy is successfully completed. I think >> that this even works on Windows. Could that just be documented as a >> strong recommendation for the archive script? > > This is exactly what I always do. I think the way cp is shown in the > examples promotes what's really a bad practice for lots of reasons, > this particular problem being just one of them. > > I've been working on an improved archive_command shell script that I > expect to submit for comments and potential inclusion in the > documentation as a better base for other people to build on. This is > one of the options for how it can operate. It would be painful but not > impossible to convert a subset of that script to run under Windows as > well, at least enough to cover this particular issue. > > A Perl script using the (standard) File::Copy module along with the builtin function rename() should be moderately portable. It would to be nice not to have to maintain two scripts. cheers andrew