pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL-documentation <pgsql-docs@postgresql.org>
Subject: Re: pg_xlogdump -p option correction
Date: Fri, 6 Jan 2017 20:02:57 -0500
Message-ID: <20170107010257.GB3164@momjian.us> (raw)
In-Reply-To: <CAB7nPqTW2iH70tJkhu8U9AUmVKB43gR0FvODmctqS=+fjuuzhA@mail.gmail.com>
References: <20161226215604.GA24784@momjian.us>
	<CAB7nPqTW2iH70tJkhu8U9AUmVKB43gR0FvODmctqS=+fjuuzhA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@momjian.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@momjian.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 +

-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Attachments:

xlogdump.diff (text/x-diff, 2.3K) download diff --git a/doc/src/sgml/ref/pg_xlogdump.sgml b/doc/src/sgml/ref/pg_xlogdump.sgml new file mode 100644 index cfb6d87..a229581 *** a/doc/src/sgml/ref/pg_xlogdump.sgml --- b/doc/src/sgml/ref/pg_xlogdump.sgml *************** PostgreSQL documentation *** 118,125 **** <listitem> <para> Directory in which to find log segment files. The default is to search ! for them in the <literal>pg_wal</literal> subdirectory of the current ! directory. </para> </listitem> </varlistentry> --- 118,126 ---- <listitem> <para> Directory in which to find log segment files. The default is to search ! for them in the current directory, and the <literal>pg_wal</literal> ! subdirectory of both the current directory and the ! <envar>PGDATA</envar> directory. </para> </listitem> </varlistentry> diff --git a/src/bin/pg_xlogdump/pg_xlogdump.c b/src/bin/pg_xlogdump/pg_xlogdump.c new file mode 100644 index 0ad441e..9e92f25 *** a/src/bin/pg_xlogdump/pg_xlogdump.c --- b/src/bin/pg_xlogdump/pg_xlogdump.c *************** usage(void) *** 680,686 **** printf(_(" -f, --follow keep retrying after reaching end of WAL\n")); printf(_(" -n, --limit=N number of records to display\n")); printf(_(" -p, --path=PATH directory in which to find log segment files\n" ! " (default: ./pg_wal)\n")); printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR\n" " use --rmgr=list to list valid resource manager names\n")); printf(_(" -s, --start=RECPTR start reading at log position RECPTR\n")); --- 680,686 ---- printf(_(" -f, --follow keep retrying after reaching end of WAL\n")); printf(_(" -n, --limit=N number of records to display\n")); printf(_(" -p, --path=PATH directory in which to find log segment files\n" ! " (default: current directory, ./pg_wal, $PGDATA/pg_wal)\n")); printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR\n" " use --rmgr=list to list valid resource manager names\n")); printf(_(" -s, --start=RECPTR start reading at log position RECPTR\n"));

view thread (9+ messages)  latest in thread

Message-ID: <20170107010257.GB3164@momjian.us>
Permalink:  ../20170107010257.GB3164@momjian.us/
Also on:    postgresql.org/message-id/20170107010257.GB3164@momjian.us

 ·  · 

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: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us, michael.paquier@gmail.com
  Subject: Re: pg_xlogdump -p option correction
  In-Reply-To: <20170107010257.GB3164@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox