Re: pg_resetwal: add --cluster-state option - Mailing list pgsql-hackers

From Sho Ito
Subject Re: pg_resetwal: add --cluster-state option
Date
Msg-id CAG7L5+46HDFiHtWiT2=ExsPtqgp6bks8-9ojuM345++0tZkmNA@mail.gmail.com
Whole thread
In response to pg_resetwal: add --cluster-state option  (shihao zhong <zhong950419@gmail.com>)
List pgsql-hackers
On Mon, Oct 5, 2026 at 12:03 AM shihao zhong <zhong950419@gmail.com> wrote:
The patch adds --cluster-state. It takes shut-down, which is the
default, shut-down-in-recovery, shutting-down, in-crash-recovery,
in-archive-recovery or in-production. DB_STARTUP is left out because
the server refuses to start with it.

Hi Shihao,

I tested the patch and confirmed that the default behaviour preserves
the unlogged table's 1,000 rows, while `--cluster-state=in-production`
causes the table to be emptied on the next startup, as described.

I noticed that an invalid value for `--cluster-state` directs the user
to `--help`, but the help output doesn't list the accepted values.
Would it be useful to include them there, similar to how `pg_ctl --help`
lists the values for `--mode`?

```
  -m, --mode=MODE        MODE can be "smart", "fast", or "immediate"
```

Kind regards,
Sho Ito

--
=======================================
Sho Ito (Sean)

=======================================

pgsql-hackers by date:

Previous
From: Manu
Date:
Subject: Re: Fix doc: explanation of how postgres works when OOM killer is invoked
Next
From: solai v
Date:
Subject: Re: Idea to enhance pgbench by more modes to generate data (multi-TXNs, UNNEST, COPY BINARY)