Use iterator in pqxx storage backend