Crashes if postgresql can't close