Stop a Postgres restart (or error) taking the whole app down

Addresses #1854.