Make sure that psql socket disconnection is handled properly.