Re: pg_resetwal --next-transaction-id may cause database failed to restart. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg_resetwal --next-transaction-id may cause database failed to restart.
Date
Msg-id 20200709051835.GA8638@alvherre.pgsql
Whole thread Raw
In response to Re: pg_resetwal --next-transaction-id may cause database failed to restart.  ("movead.li@highgo.ca" <movead.li@highgo.ca>)
List pgsql-hackers
On 2020-Jul-09, movead.li@highgo.ca wrote:

> >> ISTM that a reasonable compromise is that if you use -x (or -c, -m, -O)
> >> and the input value is outside the range supported by existing files,
> >> then it's a fatal error; unless you use --force, which turns it into
> >> just a warning.
>  
> >One potential problem is that you might be using --force for some
> >other reason and end up forcing this, too. But maybe that's OK.
> Yes it's true, so I try to add a new option to control this behavior, you
> can see it in the last mail with attach.

It may be OK actually; if you're doing multiple dangerous changes, you'd
use --dry-run beforehand ... No?  (It's what *I* would do, for sure.)
Which in turns suggests that it would good to ensure that --dry-run
*also* emits a warning (not an error, so that any other warnings can
also be thrown and the user gets the full picture).

I think adding multiple different --force switches makes the UI more
complex for little added value.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Implement UNLOGGED clause for COPY FROM
Next
From: Amit Khandekar
Date:
Subject: Re: Auto-vectorization speeds up multiplication of large-precision numerics