az postgres flexible-server stop --resource-group <resource_group> --name <server>
如果尝试停止未处于 Available 状态的服务器,将显示以下错误:
Server will be automatically started after 7 days if you do not perform a manual start operation
(ServerIsNotReady) Restart or Stop Server can only be performed on Started servers. Server Name = <server>, Current Server State = Stopped
Code: ServerIsNotReady
Message: Restart or Stop Server can only be performed on Started servers. Server Name = <server>, Current Server State = Stopped
注意
在服务器停止后,其他管理操作将不再可用于 Azure Database for PostgreSQL 灵活服务器实例。
虽然 Azure Database for PostgreSQL 灵活服务器处于停止状态,但可以出于计划的每月维护的需要临时重启,之后再恢复为停止状态。 此过程可确保即使处于停止状态的实例也能完成所有必要的修补升级,保持最新状态。