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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: 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-19 13:26:49
Message-ID: 4DFDF919.8080704@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 06/19/2011 08:00 AM, Bruce Momjian wrote:
> Tom Lane wrote:
>> Bruce Momjian<bruce(at)momjian(dot)us> writes:
>>> Perhaps we should recommend:
>>> cd /path&& test ! -f %f&& cp %p %f
>>> That is shorter and removes the duplicate problem.
>> Um ... %p is relative to the database directory.
> Oh, I see now. I had thought it was an absolute path, but good thing it
> isn't because of the possible need for quoting characters in the path
> name.
>
> The only other idea I have is:
>
> NEW=/path&& test ! -f $NEW/%f&& cp %p $NEW/%f
>
> but that is not going to work with csh-based shells, while I think the
> original is fine.

Isn't this invoked via system()? AFAIK that should always invoke a
Bourne shell or equivalent on Unix. But in any case, I think you're
trying to solve a problem that doesn't really exist.

cheers

andrew

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message David Fetter 2011-06-19 15:59:18 Re: [COMMITTERS] pgsql: Make external_pid_file world readable
Previous Message User Hinoue 2011-06-19 12:35:38 psqlodbc - psqlodbc: Fix compilation errors 2.

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2011-06-19 13:38:21 Re: [WIP] cache estimates, cache access cost
Previous Message Florian Pflug 2011-06-19 13:09:28 Re: patch for 9.2: enhanced errors