Re: [HACKERS] Bug in WAL backup documentation

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, <pgsql-hackers(at)postgresql(dot)org>, "Bernd Helmle" <mailings(at)oopsware(dot)de>, <pgsql-patches(at)postgresql(dot)org>, "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
Subject: Re: [HACKERS] Bug in WAL backup documentation
Date: 2006-11-05 15:02:11
Message-ID: 1162738932.3587.904.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Sat, 2006-11-04 at 13:29 -0500, Tom Lane wrote:
> "Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
> >> On Fri, Nov 03, 2006 at 11:25:09AM -0500, Tom Lane wrote:
> >>> Since 8.1 has done this all along and no one's actually complained about
> >>> it, I guess no one is using scripts that do "cd". I'm inclined to go
> >>> with Bernd's suggestion to change the docs to match the code, but does
> >>> anyone have a contrary opinion?
>
> > +1 Doc bug for 8.2, feature request for 8.3, unless Windows bites.
>
> Looking back in the archives, I note that one of the arguments for
> making the server use relative paths everywhere was so that it'd be
> robust against things like DBAs moving directories that contain live
> postmasters. If we provide a %P option, or otherwise encourage people
> to write scripts that depend on the absolute path of $PGDATA, we'd lose
> some of this robustness. So that might be an argument for leaving the
> code as-is indefinitely ... not a very strong argument maybe, but it's
> more than just we're-too-lazy-to-add-%P.
>
> Anyway, I've corrected the documentation in HEAD and 8.1.

I think I can fulfil Bernd, Florian and Martijn's wishes by supplying an
additional substitutable parameter %d which is replaced by the DataDir.
This allows people to use an absolute directory if they wish, allows us
to continue with the functionality of %p as-is and all without a
possible confusion between %p and %P. It also allows %d to be used as an
identifier which might be used to locate the appropriate archive for
those with multiple servers without editing the archive_command for each
of those servers.

So using %d/%p will give you the absolute path for forward-slashers.
Works for archive and recovery.

Patch included, code and docs.
Code comments now discuss relative paths also.

Comments?

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
pitr_percentd.patch text/x-patch 6.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message mark 2006-11-05 15:45:23 Re: PostgreSQL 8.2 (from CVS devel) first impressions
Previous Message Stefan Kaltenbrunner 2006-11-05 13:52:59 Re: WITH SYSID dropped

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-11-05 16:10:13 Re: [HACKERS] Bug in WAL backup documentation
Previous Message Heikki Linnakangas 2006-11-05 12:35:37 Re: WIP patch for tuple freezing issues