By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,541 Members | 1,455 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,541 IT Pros & Developers. It's quick & easy.

psql buffering

P: n/a
If I give psql the -A option, does it still wait for all the data to come in before
starting output?
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.

--
Martijn van Oosterhout <kl*****@svana.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


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/T/dGY5Twig3Ge+YRAoENAJ4jDDuNSf1NvDf3Dbm4CLEa8HsscwCf dt2U
s9ZZYJE+GkyQXGG2cIznvV0=
=ufh6
-----END PGP SIGNATURE-----

Nov 11 '05 #2

P: n/a
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 ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #3

P: n/a
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 ma*******@postgresql.org so that your
message can get through to the mailing list cleanly


--
Martijn van Oosterhout <kl*****@svana.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


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/UV6EY5Twig3Ge+YRAuL4AJ992+Iwa0+p6YeUdoOsW74GzRDXaA Cg1mLS
3ideks+QABW/ESNk+KTiDFw=
=5Crd
-----END PGP SIGNATURE-----

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.