Hello @Josh Knepfle
Welcome to the Microsoft Q&A Platform! Thank you for reaching out with your question.
We understand that you encountered an issue where your Azure PostgreSQL Flexible Server got stuck in a hung state when you tried to stop it due to a lack of connections. After our discussion via private message, you confirmed that your server has been successfully stopped, restarted, and is now back online. I'm very pleased to hear that your issue has been resolved.
For more information, please refer to this document:
https://techcommunity.microsoft.com/blog/adforpostgresql/why-restarting-azure-database-for-postgresql-took-long/1885780
**
Check Connection Limit**: To prevent running out of connections in the future, you can check your max_connections parameter on parameters page for Azure Database for PostgreSQL – Flexible Server. You can tune max_connections on Postgres Flexible Server, where it can be set to 5,000 maximum connections.
Monitor Connections: You can monitor the current connections to the PostgreSQL database using the following SQL query: ```SQL SELECT * FROM pg_stat_activity;
By following these steps, you should be able to adjust the connection settings to prevent this issue in the future.
If the issue persists, please let us know here. We will provide more details and do our best to assist you further.
Thank you.