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 20140312093001.GA13049@gmail.com
Whole thread Raw
In response to Re: libpq - lack of support to set the fetch size  (matshyeq <matshyeq@gmail.com>)
Responses Re: libpq - lack of support to set the fetch size  (matshyeq <matshyeq@gmail.com>)
List pgsql-general
On Tue, Mar 11, 2014 at 12:39:12PM +0000, matshyeq wrote:
> - when using PQsetSingleRowMode() function - does it give an option to
> define how many rows to cache on client's side (like JDBC setFetchSize()
> does) or leaves it at pqlib's discretion?

This option would not make sense as you are not "fetching" anything,
full resultset is being streamed from server over TCP connection.

> - is it/would it be possible to add corresponding option to pgAdmin to
> limit initially (and each subsequently) returned rows in Query Tool by
> custom defined max value?

It could close connection in the middle of resultset but that seems like
bad idea.  LIMIT N or FETCH N are better for such task.

--
marko



pgsql-general by date:

Previous
From: Peter Mogensen
Date:
Subject: Re: Plan rows - 1 or many
Next
From: Marko Kreen
Date:
Subject: Re: libpq - lack of support to set the fetch size