Eliminate use of ExecuteSqlQueryForSingleRow, which is not in 9.1.

Hopefully, this will unbreak the buildfarm.

Andres Freund