Also, this function iterates. In the optional (eg. SELECT) case should it only try once? There's no impact in not retrying if there is no failure to report if the first attempt fails.