sudo pg_ctlcluster 16 main promote

Category: Databases & SQL

sudo pg_ctlcluster 16 main promote

Promote a standby cluster to primary

Switches a standby cluster into the primary role so it accepts writes, the manual failover step in a streaming-replication setup. Only promote a standby that has caught up, and do not let the old primary reconnect afterwards or the two servers will diverge. Confirm role with SELECT pg_is_in_recovery().
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.