How to Fix PostgreSQL Error: Database System Was Shut Down

This message appears in logs indicating PostgreSQL was properly shut down. When seen as an error, it means attempting to connect to a stopped server.

Impact

Database is unavailable. All connection attempts fail until server is restarted.

Common Causes

  1. Intentional shutdown for maintenance
  2. Server stopped by administrator
  3. System reboot
  4. Automated shutdown scripts
  5. Out of memory killer

Troubleshooting and Resolution Steps

  1. Check server status:

    sudo systemctl status postgresql
    
  2. Start PostgreSQL:

    sudo systemctl start postgresql
    
    # Enable auto-start on boot
    sudo systemctl enable postgresql
    
  3. Check why it stopped:

    # Check logs
    sudo journalctl -u postgresql -n 100
    
    # Check for OOM killer
    sudo dmesg | grep -i "out of memory"
    

Additional Information

  • Clean shutdown is normal and safe
  • Check logs to understand why shutdown occurred
  • Configure auto-start for production systems
  • Monitor for unexpected shutdowns

Frequently Asked Questions

Q: Is "shut down" message an error?
A: No if intentional. Yes if unexpected - investigate cause.

Q: How do I prevent unexpected shutdowns?
A: Monitor resources, configure proper memory limits, enable auto-start, use process monitoring.

Pulse - Elasticsearch Operations Done Right

Pulse can solve your Elasticsearch issues

Subscribe to the Pulse Newsletter

Get early access to new Pulse features, insightful blogs & exclusive events , webinars, and workshops.

We use cookies to provide an optimized user experience and understand our traffic. To learn more, read our use of cookies; otherwise, please choose 'Accept Cookies' to continue using our website.