Re: libpq - lack of support to set the fetch size - Mailing list pgsql-general

From Marko Kreen
Subject Re: libpq - lack of support to set the fetch size
Date
Msg-id 20140310135306.GA6253@gmail.com
Whole thread Raw
In response to Re: libpq - lack of support to set the fetch size  (Albe Laurenz <laurenz.albe@wien.gv.at>)
List 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



pgsql-general by date:

Previous
From: Anh Pham
Date:
Subject: Re: execute table query in backend
Next
From: Anh Pham
Date:
Subject: [NOVICE]Convert Datum to an user-defined data type?