An Azure managed PostgreSQL database service for app development and deployment.
Hello Bruno Godoi
It sounds like you're having a tough time with your Postgres database not starting correctly on Azure.
Here are some steps to troubleshoot your issue:
Check Service Health: First, see if there are any ongoing issues with Azure services in your region. You can check the Azure Service Health Dashboard to see if there are reported issues.
Review Firewall Settings: Ensure that your client and server firewall settings are configured correctly to allow connections. Make sure that your client IP address is permitted access to your Azure PostgreSQL server.
Long-Running Transactions: If there are any long-running transactions, they might be blocking the initialization process. You can check for these using the pg_stat_activity view:
SELECT pid, usename, state, query, age(now(), query_start) AS age
FROM pg_stat_activity
WHERE state != 'idle'
ORDER BY age DESC;
If you find any long-running transactions, consider terminating them if appropriate.
Check the Status of the Database: Go to the Azure portal and check the status of your Cosmos DB Postgres database. If it's still stuck, note the time it’s been stuck and any transaction logs or messages related to its status.
Connectivity Issues: Make sure that the admin and user connection strings you're using are correctly formed. Double-check the Azure portal for the appropriate connection strings for your application.
Manual Restart: If all else fails, you might have to force a restart of the database. However, ensure that there are no active or long-running transactions before doing this to prevent extended downtime.
See Azure Documentation: Utilize Azure's own documentation on troubleshooting Postgres databases. Here’s a useful article: Troubleshoot connection issues to Azure Database for PostgreSQL.
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.