@subhash-DBA
Thank you for the question and for using Microsoft Q&A platform.
The commands you mentioned for planned and forced failover are indeed correct. In Azure PostgreSQL Flexible Server, failover operations are integrated into the restart command. This is because a failover involves switching the primary server to a standby server, which inherently requires a restart of the server to complete the process.
Why Restart is Required:
Planned Failover: This is used for maintenance or testing purposes and ensures minimal downtime by gracefully switching the primary server to the standby server.
Forced Failover: This is used in emergency situations where the primary server is unresponsive. It forces the failover to the standby server, which might result in some data loss but ensures high availability.
The restart command with the --failover option ensures that the failover process is handled correctly, maintaining the integrity and availability of your database.
Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.