On Sun, Jan 8, 2017 at 1:20 AM, Bruce Momjian <br...@momjian.us> wrote:
> On Sat, Jan  7, 2017 at 09:50:32PM +0900, Michael Paquier wrote:
>> >> 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.
>>
>> I am reading that as "only the current directory", not "the current
>> directory, then current directory + pg_wal". Do you think that this
>> sentence implies that the check routine looks as well at
>> current_dir/pg_wal?
>>
>> > Updated patch attached.
>>
>> +        subdirectory of both the current directory and the
>> +        <envar>PGDATA</envar> directory.
>> This could say "of both the current directory and *then* the PGDATA
>> directory" to outline the order of the actions taken by the check
>> routine. Just my 2c on the matter.
>
> Ah, I see your point.  I ended up rewording the text to be more explicit
> about the supplied argument and "searching".  Updated patch attached.

-        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.
+        Specifies a directory in which to find log segment files.
+        In addition, searches are performed in the current directory,
+        and the <literal>pg_wal</literal> subdirectory of both the current
+        directory and the <envar>PGDATA</envar> directory.
Hm. This still misses the point that the lookup at PGDATA is done only
if no directory is defined. What do you think about the patch attached
that lists the five possible patterns: 2 for the case where a
directory is defined, and 3 for the default case.
-- 
Michael
diff --git a/doc/src/sgml/ref/pg_xlogdump.sgml 
b/doc/src/sgml/ref/pg_xlogdump.sgml
index cfb6d87259..e66221a41c 100644
--- a/doc/src/sgml/ref/pg_xlogdump.sgml
+++ b/doc/src/sgml/ref/pg_xlogdump.sgml
@@ -117,8 +117,13 @@ PostgreSQL documentation
       <term><option>--path=<replaceable>path</replaceable></option></term>
       <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
+        Specifies a directory in which to find log segment files.
+        If log segment files are not found in the directory defined, a search
+        is done as well in <literal>pg_wal</literal> subdirectory of the
+        defined path. The default is to search for them in the current
+        directory, then in the <literal>pg_wal</literal> subdirectory of the
+        current directory, and finally in the <literal>pg_wal</literal>
+        subdirectory of <envar>PGDATA</envar>.
         directory.
        </para>
       </listitem>
diff --git a/src/bin/pg_xlogdump/pg_xlogdump.c 
b/src/bin/pg_xlogdump/pg_xlogdump.c
index 0ad441e22e..26d784459d 100644
--- a/src/bin/pg_xlogdump/pg_xlogdump.c
+++ b/src/bin/pg_xlogdump/pg_xlogdump.c
@@ -679,8 +679,10 @@ usage(void)
        printf(_("  -e, --end=RECPTR       stop reading at log position 
RECPTR\n"));
        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(_("  -p, --path=PATH        directory in which to find log 
segment files,\n"
+                        "                         the pg_wal subdirectory of 
defined directory being\n"
+                        "                         looked at as well. (default: 
current directory,\n"
+                        "                         ./pg_wal and 
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"));
-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply via email to