For developers and data engineers, there is nothing more critical than database availability. When PostgreSQL goes down, your entire application typically follows. Whether you are using a managed service like Amazon RDS, Supabase, or a self-hosted instance on a Linux VPS, the immediate need is to determine: is the database down globally, or is it a local networking issue?
How to Check if PostgreSQL is Down (By Hosting Type)
Because PostgreSQL is a database engine and not a single centralized website, "checking if it is down" depends entirely on where your instance lives.
1. Managed Cloud Services (PaaS/DBaaS)
If you use a provider like AWS RDS, Google Cloud SQL, Azure Database for PostgreSQL, or Supabase, you are dependent on their infrastructure.
- Official Status Pages: Visit the provider\'s status dashboard (e.g., health.aws.amazon.com).
- Control Panel: Check the instance status in your cloud console. If it says "Stopping" or "Error", the issue is on their end.
- Social Signals: Search "AWS RDS down" or "Supabase status" on X/Twitter for real-time user reports.
2. Self-Hosted PostgreSQL Instances
For databases running on your own servers, you need to verify the process and connectivity manually.
# Check if Postgres is accepting connections
pg_isready -h localhost -p 5432
If pg_isready returns "no response", your database is likely down. Check the system logs via journalctl -u postgresql to find the root cause.
๐ก Monitor PostgreSQL uptime every 30 seconds โ get alerted in under a minute
Trusted by 100,000+ websites ยท Free tier available
3. Verifying Local Connectivity
Sometimes the database is fine, but your connection is broken. Try these tests:
- Telnet/NC Test: Run
nc -zv [host] 5432to see if the port is open. - VPN/Firewall: Ensure your IP is whitelisted in the database security group.
- DNS Check: Try connecting via the IP address instead of the hostname to rule out DNS failures.
Secure your database credentials
Stop storing Postgres passwords in plain text .env files. Use 1Password to securely manage and inject database secrets into your production environment.
Try 1Password Free โCommon PostgreSQL Outage Causes
Database failures are rarely random. They usually fall into one of these patterns:
- OOM Killer (Out of Memory): Linux may kill the Postgres process if the server runs out of RAM. Check
dmesg | grep -i oom. - Disk Space Exhaustion: If the disk fills up, Postgres cannot write to the WAL (Write-Ahead Log) and will shut down to prevent data corruption.
- Connection Limit Reached: If too many clients connect simultaneously, new connections will be rejected with
FATAL: sorry, too many clients already. - Lock Contention: A long-running migration or heavy query can lock critical tables, making the database appear "down" to the application.
Monitor your PostgreSQL availability automatically
Don't wait for users to tell you your database is down. Better Stack provides instant alerts for database outages and performance degradation.
Try Better Stack Free โFrequently Asked Questions
How do I restart PostgreSQL if it is down?
On most Linux systems, use: sudo systemctl restart postgresql. Always check the logs first to ensure you aren't restarting into a crash loop.
Is there a difference between "Connection Refused" and "Connection Timeout"?
Connection Refused means the server is there but not accepting connections on that port. Timeout means the server didn't respond at all, usually due to a firewall or a complete server crash.
How can I prevent my Postgres database from going down?
Implement a robust backup strategy, set up resource limits, use a connection pooler like PgBouncer, and employ 24/7 uptime monitoring with instant alerts.
Secure your infrastructure data
Database leaks are often a result of exposed credentials. Optery helps you manage your digital footprint and reduce the risk of targeted attacks on your infrastructure.
Scan Free with Optery โAlert Pro
14-day free trialStop checking โ get alerted instantly
Next time PostgreSQL goes down, you'll know in under 60 seconds โ not when your users start complaining.
- Email alerts for PostgreSQL + 9 more APIs
- $0 due today for trial
- Cancel anytime โ $9/mo after trial