Re: [HACKERS] libpq: why we need to fetch all rows? - Mailing list pgsql-hackers

From Igor
Subject Re: [HACKERS] libpq: why we need to fetch all rows?
Date
Msg-id 036befc3b9949a30e6a2f6ec22074780
Whole thread Raw
In response to [HACKERS] libpq: why we need to fetch all rows?  (Alexander Demenshin <aldem@techie.com>)
List pgsql-hackers
Does the portal store all the rows at the backend and feed them one by one
to the client, or does it go out to disk to get new rows?

=+=------------------------/\---------------------------------=+=
       Igor Natanzon      |**|   E-mail: igor@sba.miami.edu
=+=------------------------\/---------------------------------=+=

On Sun, 29 Jun 1997, Bruce Momjian wrote:

> >
> > On Sun, Jun 29, 1997 at 01:44:36PM -0400, Bruce Momjian wrote:
> >
> > > Because it is not standard SQL.  No database I know of returns multiple
> > > rows with out a 'declare' statement and a cursor.
>
> Actually, standard SQL requires a cursor so you can name the cursor to
> fetch from, but PostgreSQL requires it to be in a transaction, which is
> not standard.
>
> >
> >   Not so good... But then, why not to modify backend and libpq
> >   in a way, which will allow to fetch rows one-by-one?
>
> OK, can you run a test?  If you start a transaction, declare a cursor,
> and do a fetch over and over again, does it return one line at a time
> from the server.  I think it does.
>
> Now, it will not return from the first fetch until the query has
> finished executing, but I don't think it will send all the results to
> the client, only one at a time.
>
> --
> Bruce Momjian
> maillist@candle.pha.pa.us
>

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

End of hackers-digest V1 #404
*****************************

pgsql-hackers by date:

Previous
From: Igor
Date:
Subject: Re: [HACKERS] libpq: why we need to fetch all rows?
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] libpq: why we need to fetch all rows?