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

From: Thom Brown <thom(at)linux(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 08:05:10
Message-ID: BANLkTi=9D4FqPGbm_P2eMmJW6yQTzq6q0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 18 June 2011 04:13, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Bruce Momjian wrote:
>>
>> Wow, this is the first I am hearing GNU cp -i can return zero exit if it
>> doesn't do the copy.  I tested this on Ubuntu 10.04 using cp 7.4 and
>> got:
>>
>>       $ touch x y
>>       $ cp -i x y; echo $?
>>       cp: overwrite `y'? n
>>       0
>>
>> I see the same on my anchent BSD/OS machine too:
>>
>>       $ touch x y
>>       $ cp -i x y; echo $?
>>       overwrite y? n
>>       0
>>
>> Were we expecting an error if the file already existed?  Assuming that,
>> we should assume the file will always exist so basically archiving will
>> never progress.  Is this what we want?  I just wasn't aware we were
>> expecting an already-existing this to be an error --- I thought we just
>> didn't want to overwrite it.
>
> I tested on FreeBSD 7.4 and saw a 1 error return:
>
>        $ touch x y
>        $ cp -i x y; echo $?
>        overwrite y? (y/n [n]) n
>        not overwritten
>        1

And on a Mac (so through Darwin 10.7.0 a BSD version too):

toucan:tmp thom$ touch x y
toucan:tmp thom$ cp -i x y; echo $?
overwrite y? (y/n [n]) n
not overwritten
1

Thom

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message User Hinoue 2011-06-18 11:26:42 psqlodbc - psqlodbc: Now SQLDescribeCol() can detect the changes of
Previous Message Bruce Momjian 2011-06-18 03:13:09 Re: Re: [COMMITTERS] pgsql: Don't use "cp -i" in the example WAL archive_command.

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-06-18 08:10:01 Re: Range Types and extensions
Previous Message Jaime Casanova 2011-06-18 06:57:22 Re: creating CHECK constraints as NOT VALID