code: def nextset(self):
          
          # skip any data for this set if exists
          self.flush_to_end_of_result()
  
          if self._message is None:
              return False
          elif isinstance(self._message, END_OF_RESULT_RESPONSES):
              # there might be another set, read next message to find out
              self._message = self.connection.read_message()
              if isinstance(self._message, messages.RowDescription):
                  self.description = [Column(fd, self.unicode_error) for fd in self._message.fields]
                  self._message = self.connection.read_message()
                  return True
              elif isinstance(self._message, messages.BindComplete):
                  self._message = self.connection.read_message()
                  return True
              elif isinstance(self._message, messages.ReadyForQuery):
                  return False
              elif isinstance(self._message, END_OF_RESULT_RESPONSES):
                  # result of a DDL/transaction
                  return True
              elif isinstance(self._message, messages.ErrorResponse):
                  raise errors.QueryError.from_error_response(self._message, self.operation)
              else:
                  raise errors.MessageError(
                      'Unexpected nextset() state after END_OF_RESULT_RESPONSES: {0}'.format(self._message))
          elif isinstance(self._message, messages.ReadyForQuery):
              # no more sets left to be read
              return False
          else:
              raise errors.MessageError('Unexpected nextset() state: {0}'.format(self._message))
docs: Skip to the next available result set, discarding any remaining rows
          from the current result set.
  
          If there are no more result sets, this method returns False. Otherwise,
          it returns a True and subsequent calls to the fetch*() methods will
          return rows from the next result set.