Re: pg_resetwal: add --cluster-state option

From: Sho Ito <i(dot)sho(dot)0628(at)gmail(dot)com>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, David Steele <david(at)pgbackrest(dot)org>
Subject: Re: pg_resetwal: add --cluster-state option
Date: 2026-10-08 04:25:44
Message-ID: CAG7L5+46HDFiHtWiT2=ExsPtqgp6bks8-9ojuM345++0tZkmNA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 5, 2026 at 12:03 AM shihao zhong <zhong950419(at)gmail(dot)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)*

E-mail: i(dot)sho(dot)0628(at)gmail(dot)com
LinkedIn: *https://www.linkedin.com/in/sho-ito-0628/
<https://www.linkedin.com/in/sho-ito-0628/>*
GitHub: https://github.com/sean0628/
=======================================

In response to

Browse pgsql-hackers by date

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