Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPfPY-0007uO-M8 for pgsql-docs@arkaria.postgresql.org; Sat, 07 Jan 2017 01:03:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cPfPX-0006Ha-Ii for pgsql-docs@arkaria.postgresql.org; Sat, 07 Jan 2017 01:03:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cPfPV-0006HR-UX for pgsql-docs@postgresql.org; Sat, 07 Jan 2017 01:03:06 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cPfPO-00015k-M2 for pgsql-docs@postgresql.org; Sat, 07 Jan 2017 01:03:04 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1cPfPN-0002cq-9y; Fri, 06 Jan 2017 20:02:57 -0500 Date: Fri, 6 Jan 2017 20:02:57 -0500 From: Bruce Momjian To: Michael Paquier Cc: PostgreSQL-documentation Subject: Re: pg_xlogdump -p option correction Message-ID: <20170107010257.GB3164@momjian.us> References: <20161226215604.GA24784@momjian.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 27, 2016 at 01:28:17PM +0900, Michael Paquier wrote: > On Tue, Dec 27, 2016 at 6:56 AM, Bruce Momjian 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 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 + --G4iJoqBmSsgzjUCe Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="xlogdump.diff" 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 **** Directory in which to find log segment files. The default is to search ! for them in the pg_wal subdirectory of the current ! directory. --- 118,126 ---- Directory in which to find log segment files. The default is to search ! for them in the current directory, and the pg_wal ! subdirectory of both the current directory and the ! PGDATA directory. 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")); --G4iJoqBmSsgzjUCe Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs --G4iJoqBmSsgzjUCe--