Reconnect after connection close (for example after PostgreSQL server restart)