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" ```