Re: libpq - lack of support to set the fetch size

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: libpq - lack of support to set the fetch size
Дата
Msg-id 531D8A50.2070603@hogranch.com
обсуждение исходный текст
Ответ на libpq - lack of support to set the fetch size  (matshyeq <matshyeq@gmail.com>)
Список pgsql-general
On 3/9/2014 6:43 AM, matshyeq wrote:
Hello,

I've found an issue when tried to implement fetching rows from big table (2mln rows) in my app.
Basically I don't find an elegant and easy way (other than always use cursors) to limit the number of rows returned.
This causes my application to break due to the excessive memory consumption.

I'm using Perl and DBD::Pg library but contacted maintainer who actually pointed out this is an issue that goes much deeper (libpq):

"Unfortunately, this is a limitation in the underlying driver (libpq) rather than DBD::Pg itself. There have been talks over the years of supporting this, but nothing concrete yet. Your best bet would be to ask about this on the Postgres lists"


in addition to what the others suggested, you can use a CURSOR to read through results in arbitrary sized blocks.
-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast

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

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: libpq - lack of support to set the fetch size
Следующее
От: Anh Pham
Дата:
Сообщение: Re: execute table query in backend