public inbox for [email protected]
help / color / mirror / Atom feedFrom: Greg Smith <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Josh Kupershmidt <[email protected]>
Cc: [email protected]
Subject: Re: confusing archive_command example
Date: Thu, 01 Apr 2010 08:17:37 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
Peter Eisentraut wrote:
> On ons, 2010-03-31 at 19:51 -0400, Bruce Momjian wrote:
>
>> Also, should we be using test ! -e instead of -f?
>>
>
> test -e is not portable.
>
Right; there are plenty of shells where "test -e" isn't implemented, I
believe some Solaris and/or HP-UX systems have that issue. The original
"test -f" was already the best example to give here.
As for the update Josh suggested, there are two issues here. The PITR
documentation at
http://developer.postgresql.org/pgdocs/postgres/continuous-archiving.html
starts with this example:
archive_command = 'cp -i %p /mnt/server/archivedir/%f </dev/null'
And then it used to show this one (now it has 'test -e'):
archive_command = 'test ! -f .../%f && cp %p .../%f'
I agree this is confusing. That second line should just read like this
to match the other examples:
archive_command = 'test ! -f /mnt/server/archivedir/%f && cp %p
/mnt/server/archivedir/%f'
And to revert the "test -e" change.
The third issue here, not mentioned yet, is that there's also an example
of setting up archive_command in its GUC documentation:
http://developer.postgresql.org/pgdocs/postgres/runtime-config-wal.html
This has drifted out of sync with the section being updated here this
week--its archive_command example isn't even using "-i". I think the
right thing to do here is to migrate the Windows example out of 18.5.3
from 24.3.1, then replace the existing examples in 18.5.3 to instead
suggest 24.3.1 has them. Given that all of this documentation giving
examples for how to correctly configure that parameter, like this cp
trivia, only appears in the PITR docs section, I don't see any reason to
duplicate that in the GUC area. Having the second, minimally documented
version of those in 18.5.3 just encourages people to use what we know is
a bad practice by providing them as examples.
--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
[email protected] www.2ndQuadrant.us
view thread (13+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: confusing archive_command example
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox