Question aboud #80 - itersize in cursor dic

Поиск
Список
Период
Сортировка
От Kryklia Alex
Тема Question aboud #80 - itersize in cursor dic
Дата
Msg-id CAGv7O6OQ7kWBjtyLo9gyF9h+Kt_zLBF3fiaxatCSQ_UtyZXNLQ@mail.gmail.com
обсуждение исходный текст
Ответы Question aboud #80 - itersize in cursor dic  (Kryklia Alex <kryklia@gmail.com>)
Re: Question aboud #80 - itersize in cursor dic  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список psycopg
Hi!
Thank for great library.
Dear group users, please help me with understanding of situation.

in psycopg2 extras.py

in 2.4.4 was:
  89     def __iter__(self):
  90         if self._prefetch:
  91             res = _cursor.fetchmany(self, self.itersize)
  92             if not res:
  93                 return
  94         if self._query_executed:
  95             self._build_index()
  96         if not self._prefetch:
  97             res = _cursor.fetchmany(self, self.itersize)
  98
  99         for r in res:
 100             yield r
 101
 102         # the above was the first itersize record. the following are
 103         # in a repeated loop.
 104         while 1:
 105             res = _cursor.fetchmany(self, self.itersize)
 106             if not res:
 107                 return
 108             for r in res:
 109                 yield r
 110


in 2.4.5 became:
    def __iter__(self):
        if self._prefetch:
            res = _cursor.__iter__(self)
            first = res.next()
        if self._query_executed:
            self._build_index()
        if not self._prefetch:
            res = _cursor.__iter__(self)
            first = res.next()

        yield first
        while 1:
            yield res.next()


----------------------------------------------------------------------------
and now iterating over named cursor return 1 row, not many

Please help, should i use cursor.fetchmany instead?
Or how use itersize? (Why itersize not working)

Thank You

Alex

В списке psycopg по дате отправления:

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Using a psycopg2 converter to retrieve bytea data from PostgreSQL
Следующее
От: Ottavio Campana
Дата:
Сообщение: is it possibile get the psql prompt output?