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

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: Daniel Verite *EXTERN* <daniel(at)manitou-mail(dot)org>, matshyeq <matshyeq(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: libpq - lack of support to set the fetch size
Date: 2014-03-10 13:53:06
Message-ID: 20140310135306.GA6253@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 10, 2014 at 06:58:26AM +0000, Albe Laurenz wrote:
> Daniel Verite wrote:
> > matshyeq wrote:
>
> [ runs out of memory on the client because all results from a large query are retrieved at once ]
>
> >> "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"
> >>
> >> Would you consider putting this on the roadmap, so one day it gets improved?
> >
> > This improvement seems to have actually been made since 9.2 with
> > the PQsetSingleRowMode() function:
> >
> > http://postgresql.org/docs/current/static/libpq-single-row-mode.html

> Finally, you will have a client-server round trip for each row returned.
> This is a problem you would also have when using PQsetSingleRowMode().

PQsetSingleRowMode() does not do additional roudtrips, it loads rows
from libpq internal buffer.

--
marko

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Anh Pham 2014-03-10 14:09:57 [NOVICE]Convert Datum to an user-defined data type?
Previous Message Anh Pham 2014-03-10 13:50:21 Re: execute table query in backend