On Tue, Feb 25, 2003 at 05:55:59PM +0000, Darko Prenosil wrote:
> 
> 	I am trying to create client buffer that will show only records that are
> needed by application(visible). Data should be send to client in "pages", not
> all the data at once. The idea is not to query for data that are already in
> the buffer.
 
BTW, if your applications happens to be in C++, libpqxx has a class
called CachedResult that would take a lot of this work out of your
hands.  It transparently fetches rows on-demand and caches them so
they don't get read more than once.  It can also figure out the
size of your result set for you.

You can find libpqxx at http://pqxx.tk/


Jeroen


Tue, 25 Feb 2003 18:14:42 +0100
"Jeroen T. Vermeulen" <jtv@xs4all.nl>
Re: I cant find it or I'm just lazy ?


----------  Forwarded Message  ----------

Subject: Re: [HACKERS] I cant find it or I'm just lazy ?
Date: Tue, 25 Feb 2003 17:51:13 +0000
From: Darko Prenosil <darko.prenosil@finteh.hr>
To: Christoph Haller <ch@rodos.fzk.de>

On Tuesday 25 February 2003 13:04, Christoph Haller wrote:
> > On Tuesday 25 February 2003 09:28, Christoph Haller wrote:
> > > > On Mon, Feb 24, 2003 at 07:53:05PM +0000, Darko Prenosil wrote:
> > > > >     I need two answers I did not find in documentation :
> > > > > How can I get exact number of rows in DECLARED CURSOR ?
> > > > > OK, I can FETCH until NULL, but this does not fits my needs !
> > >
> > > You may want to use FETCH ALL, otherwise what or your needs in
>
> detail?
>
> > If I use FETCH ALL all, all the data will be sent to client, then why
>
> to use
>
> > CURSOR at all ? I need to reduce network traffic on slow connections !
>
> I cannot see how you are going to reduce network traffic by knowing in
> advance
> how many rows will be returned.
> Anyway, you may MOVE until 0 instead of FETCH, or use the COUNT()
> function on the query to learn about the number of rows to be returned.

	I am trying to create client buffer that will show only records that are
needed by application(visible). Data should be send to client in "pages", not
all the data at once. The idea is not to query for data that are already in
the buffer.

Regards !

-------------------------------------------------------


Tue, 25 Feb 2003 17:55:59 +0000
Darko Prenosil <darko.prenosil@finteh.hr>
Re: I cant find it or I'm just lazy ?
On Tue, Feb 25, 2003 at 07:34:12PM +0000, Darko Prenosil wrote:
>
> Unfortunately it is application written in QT library that should work on 
> Windows too, but I'll take a look, I'm sure I can learn something from it !

Well, libpqxx also runs on Windows but it takes a decent compiler (e.g.
Visual C++ 6.0 isn't quite good enough) and some manual labour to set up
your own project file.


Jeroen


Tue, 25 Feb 2003 19:57:53 +0100
"Jeroen T. Vermeulen" <jtv@xs4all.nl>
Re: I cant find it or I'm just lazy ?
On Tuesday 25 February 2003 17:14, Jeroen T. Vermeulen wrote:
> On Tue, Feb 25, 2003 at 05:55:59PM +0000, Darko Prenosil wrote:
> > 	I am trying to create client buffer that will show only records that are
> > needed by application(visible). Data should be send to client in "pages",
> > not all the data at once. The idea is not to query for data that are
> > already in the buffer.
>
> BTW, if your applications happens to be in C++, libpqxx has a class
> called CachedResult that would take a lot of this work out of your
> hands.  It transparently fetches rows on-demand and caches them so
> they don't get read more than once.  It can also figure out the
> size of your result set for you.
>
> You can find libpqxx at http://pqxx.tk/
>
	Unfortunately it is application written in QT library that should work on 
Windows too, but I'll take a look, I'm sure I can learn something from it !

Regards !

Tue, 25 Feb 2003 19:34:12 +0000
Darko Prenosil <darko.prenosil@finteh.hr>
Re: I cant find it or I'm just lazy ?
On Tuesday 25 February 2003 18:57, Jeroen T. Vermeulen wrote:
> On Tue, Feb 25, 2003 at 07:34:12PM +0000, Darko Prenosil wrote:
> > Unfortunately it is application written in QT library that should work on
> > Windows too, but I'll take a look, I'm sure I can learn something from it
> > !
>
> Well, libpqxx also runs on Windows but it takes a decent compiler (e.g.
> Visual C++ 6.0 isn't quite good enough) and some manual labour to set up
> your own project file.
>
I got the sources yesterday. Thank you !

Wed, 26 Feb 2003 09:44:14 +0000
Darko Prenosil <darko.prenosil@finteh.hr>
Re: I cant find it or I'm just lazy ?
On Wed, Feb 26, 2003 at 09:44:14AM +0000, Darko Prenosil wrote:
>
> I got the sources yesterday. Thank you !

Let me know whether everything works for you.  There's also a mailing
list on pqxx.tk if you need it.


Jeroen


Wed, 26 Feb 2003 15:22:17 +0100
"Jeroen T. Vermeulen" <jtv@xs4all.nl>
Re: I cant find it or I'm just lazy ?