Re: pg_xlogdump -p option correction

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>
Subject: Re: pg_xlogdump -p option correction
Date: 2017-01-07 01:02:57
Message-ID: 20170107010257.GB3164@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Tue, Dec 27, 2016 at 01:28:17PM +0900, Michael Paquier wrote:
> On Tue, Dec 27, 2016 at 6:56 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > I have found that pg_xlogdump looks for WAL files in the in the current
> > directory and the pg_wal subdirectory of both the current directory and
> > the PGDATA directory. Doc patch attached.
>
> The whole behavior is listed in pg_xlogdump.c here:
> /*
> * Try to find the file in several places:
> * if directory == NULL:
> * fname
> * XLOGDIR / fname
> * $PGDATA / XLOGDIR / fname
> * else
> * directory / fname
> * directory / XLOGDIR / fname
> *
> * return a read only fd
> */
> static int
> fuzzy_open_file(const char *directory, const char *fname)
>
> Updating the docs the way your patch does does not look enough IMO:

OK.

> 1) pg_xlogdump --help should mention PGDATA as well for the default
> behavior, and should make clear the default and when -p is defined:
> -p, --path=PATH directory in which to find log segment files
> (default: ./pg_wal)

Ah, good point. The new output is:

-p, --path=PATH directory in which to find log segment files
(default: current directory, ./pg_wal, $PGDATA/pg_wal)

> 2) The documentation does not mention that if a directory is defined
> pg_xlogdump will try to look as well at defined_dir/pg_wal.

Uh, I think it does in the first sentence:

Directory in which to find log segment files.

Updated patch attached.

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

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

Attachment Content-Type Size
xlogdump.diff text/x-diff 2.3 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Michael Paquier 2017-01-07 12:50:32 Re: pg_xlogdump -p option correction
Previous Message Tom Lane 2017-01-06 15:18:21 Re: [HACKERS] Questionable tag usage