Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T5zeS-0002SN-Ib for pgsql-docs@postgresql.org; Mon, 27 Aug 2012 13:46:48 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T5zeP-0003H6-De for pgsql-docs@postgresql.org; Mon, 27 Aug 2012 13:46:47 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1T5zeL-0004eu-Ja; Mon, 27 Aug 2012 09:46:41 -0400 Date: Mon, 27 Aug 2012 09:46:41 -0400 From: Bruce Momjian To: Peter Eisentraut Cc: Josh Kupershmidt , Greg Smith , Euler Taveira de Oliveira , pgsql-docs@postgresql.org Subject: Re: somewhat wrong archive_command example Message-ID: <20120827134641.GD11088@momjian.us> References: <4E794FB5.80400@2ndQuadrant.com> <1316613536.14119.6.camel@fsopti579.F-Secure.com> <4E7A6D0D.4060106@2ndQuadrant.com> <4E7A887F.8010908@timbira.com> <20120816011347.GF8353@momjian.us> <502EA0D0.10004@gmx.net> <20120825230755.GE10814@momjian.us> <20120825234026.GG10814@momjian.us> <1346039025.5873.16.camel@vanquo.pezone.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1346039025.5873.16.camel@vanquo.pezone.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201208/46 X-Sequence-Number: 7439 On Sun, Aug 26, 2012 at 11:43:45PM -0400, Peter Eisentraut wrote: > I'm a little bit worried about this whole discussion. We have half a > dozen supposed experts working on a 10-line shell script to do WAL > archiving, and there is still > > - disagreement > - uncertainty > - bugs > > How is a normal user supposed to do this? > > That aside, I disagree with the premise for this script. It doesn't do > anything more than the typical inline examples we give. The additional > error reporting could be considered useful, but cp is perfectly capable > of reporting these errors itself, and getting in the way of that just > loses information and introduces race conditions. But if we are going > to provide a separate shell script, we should at least offer some > additional value, such as addressing the partial copy problem. But I > think that's not very easy to do in portable shell. I thought the idea was just to show what a shell script might look like --- we could say it does the same as a single-line copy, but then people could improve it, or we could add a comment to show how people could improve it. I am actually unclear how the partial copy problem would not be fixed by just using cp without -i < /dev/null. > I think what we should do is write a wrapper program in C that covers > all the bases, support all platforms, and supports a handful of the most > commonly used copy methods (cp, scp, etc. + compression). Then everyone > can just use that and doesn't have to figure all these things out from > scratch every time. I doubt it would work because people like the flexibility of shell scripts. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +