Re: psql buffering

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Joseph Shraibman <jks(at)selectacast(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: psql buffering
Date: 2003-08-31 02:33:40
Message-ID: 20030831023340.GB8472@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hmm, most of them yes. You can only run one command at a time anyway. They way
most programs deal is to make cursors for the queries and then fetch say
1000 rows at a time. This way they can process data without having to wait
for the backend.

That said, I do beleive that libpq does have the facility to read the data
as it comes in (at least, I assume that's what PQsendQuery/PQconsumeInput
are for). It's a little more involved. I've never used it since cursors
solve the problem for me and are much easier to understand.

Hope this helps,

On Sat, Aug 30, 2003 at 10:19:10PM -0400, Joseph Shraibman wrote:
> Are all interfaces like that?
>
> Martijn van Oosterhout wrote:
> >On Fri, Aug 29, 2003 at 05:10:07PM -0400, Joseph Shraibman wrote:
> >
> >>If I give psql the -A option, does it still wait for all the data to come
> >>in before starting output?
> >
> >
> >Because it's still using libpq to do the queries and it doesn't return
> >until
> >it has retrieved the entire dataset.
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> "All that is needed for the forces of evil to triumph is for enough good
> men to do nothing." - Edmond Burke
> "The penalty good people pay for not being interested in politics is to be
> governed by people worse than themselves." - Plato

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix 2003-08-31 02:58:50 Re: export data from postgresql on linux to ms-sqlserver 2000 on windows
Previous Message Joseph Shraibman 2003-08-31 02:19:10 Re: psql buffering