Re: pg_resetwal is broken if run from v10 against older version of PG data directory

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, tushar <tushar.ahuja@enterprisedb.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2017-05-29T21:12:51Z
Lists: pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
> Agreed. Shouldn't this be back-patched? PG_CONTROL_VERSION has not
> been bumped between 9.4 and 9.5. Attached is a patch for HEAD.

Pushed with minor adjustments.  Notably, I didn't take your addition
of canonicalize_path() and referencing the file by absolute path.
That seems like an independent and rather debatable behavioral change.
All the other files that pg_resetwal touches are referenced with
relative paths; if we did want to change the reporting, shouldn't we
change it for all of them?

			regards, tom lane


Commits

  1. Prevent running pg_resetwal/pg_resetxlog against wrong-version data dirs.

  2. Rename "pg_xlog" directory to "pg_wal".