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

From: matshyeq <matshyeq(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Cc: "Daniel Verite *EXTERN*" <daniel(at)manitou-mail(dot)org>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: libpq - lack of support to set the fetch size
Date: 2014-03-11 12:39:12
Message-ID: CAONr5=vYNp1TbFN4hLHkni23gANcP-Fp=6699CMzAi7Ogk=96Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marko, Tom, Adrian, Jeff, Daniel - thank you all for valuable feedback!

Two general questions:

- 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?

- 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?

@Tom

>Perhaps you should actually experiment with that solution instead of
rejecting it out of hand. Or at least RTFM about it.

As I'm not using pqlib directly I'm unable to leverage PQsetSingleRowMode()
call (or at least I'm not aware how to do this from DBD::Pg)

I simply passed you feedback given by them.

@Adrian

The example in the documentation you refer to actually demonstrates this
has been properly implemented in JDBC.

By properly I mean call to:

setFetchSize()

works, whatever it actually does behind the scenes (cursors?) it doesn't
actually require a developer to declare and utilize cursors explicitly, like

st.execute("DECLARE csr CURSOR FOR SELECT * FROM myBigTable;");

conn.prepareStatement("fetch 1000 from csr");

@Jeff

I'll make a suggestion to DBD::Pg development

@Daniel

Very interesting alternative. You're welcome to contribute to this
stackoverflow question!

Does it mean $data is a reference to single returned row of data (`COPY
formatted`)?

Kind Regards

Msciwoj

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aggarwal, Ajay 2014-03-11 12:50:07 Re: replication timeout in pg_basebackup
Previous Message Torsten Förtsch 2014-03-11 12:15:50 How to make PG use work_mem?