pg_ctlcluster - start/stop/restart/reload/promote a PostgreSQL cluster (postgresql-common)
pg_ctlcluster [OPTIONS] <version> <cluster> <action> [-- <pg_ctl options>]
Options you will use
-m, --mode=smart|fast|immediate- shutdown mode for stop/restart: smart waits for clients, fast (default) disconnects them, immediate exits without a checkpoint (crash recovery on next start).
--skip-systemctl-redirect- do not hand over to systemctl (the unit itself uses this).
-f, --force- with stop: try fast, then immediate.
-o, --options=OPTIONS- pass options to postgres.
Examples
$ sudo pg_ctlcluster 18 main reloadSIGHUP: re-read the config
$ sudo pg_ctlcluster 18 replica promoteend recovery: the replica becomes a primary
$ sudo -u postgres pg_ctlcluster 18 main stop -m immediatestop at once (crash recovery on start)
Taught in
Try pg_ctlcluster in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.