Re: Re: [COMMITTERS] pgsql: Don't use "cp -i" in the example WAL archive_command.

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thom Brown <thom(at)linux(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Don't use "cp -i" in the example WAL archive_command.
Date: 2011-06-18 22:10:53
Message-ID: 201106182210.p5IMArq20781@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Bruce Momjian wrote:
> Andrew Dunstan wrote:
> >
> >
> > On 06/18/2011 09:19 AM, Tom Lane wrote:
> > > Thom Brown<thom(at)linux(dot)com> writes:
> > >> On 18 June 2011 04:13, Bruce Momjian<bruce(at)momjian(dot)us> wrote:
> > >>> I tested on FreeBSD 7.4 and saw a 1 error return:
> > >> And on a Mac (so through Darwin 10.7.0 a BSD version too):
> > > Yeah, see yesterday's discussion on pgsql-admin. I think the behavior
> > > with the error return may be a BSD-ism. In any case, GNU cp does *not*
> > > do what we want, and that accounts for a sufficiently large fraction of
> > > machines in the field that I think it's just unsafe to suggest using
> > > "cp -i" so prominently. There are too many people who'll just copy and
> > > paste the first example provided, especially if the warning to test it
> > > is buried several paragraphs later.
> > >
> > >
> >
> > Yeah, I'm glad to see this go anyway. I always thought the example was
> > too cute by half. Using an explicit test is much nicer and more obvious.
>
> I think the only real risk to the 'test' example is the possibility that
> they will mistype the pathname in one of the two places it is required,
> or forget to change both of them at the same time.

Perhaps we should recommend:

cd /path && test ! -f %f && cp %p %f

That is shorter and removes the duplicate problem.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-06-18 22:15:10 Re: Re: [COMMITTERS] pgsql: Don't use "cp -i" in the example WAL archive_command.
Previous Message User Hinoue 2011-06-18 21:33:23 psqlodbc - psqlodbc: Take the environment variable into account.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-06-18 22:15:10 Re: Re: [COMMITTERS] pgsql: Don't use "cp -i" in the example WAL archive_command.
Previous Message Andrew Dunstan 2011-06-18 21:21:40 Re: pika buildfarm member failure on isolationCheck tests