pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: *** PROBABLY SPAM *** Does the psql executable support a "fetch many" approach when dumping large queries to stdout?
3+ messages / 3 participants
[nested] [flat]

* Re: *** PROBABLY SPAM *** Does the psql executable support a "fetch many" approach when dumping large queries to stdout?
@ 2010-04-02 20:43  Pierre C <lists@peufeu.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Pierre C @ 2010-04-02 20:43 UTC (permalink / raw)
  To: Beaver, John E <John_Beaver@hms.harvard.edu>; pgsql-performance

> Does the psql executable have any ability to do a "fetch many", using a  
> server-side named cursor, when returning results? It seems like it tries  
> to retrieve the query entirely to local memory before printing to  
> standard out.

I think it grabs the whole result set to calculate the display column  
widths. I think there is an option to tweak this but don't remember which,  
have a look at the psql commands (\?), formatting section.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: *** PROBABLY SPAM *** Does the psql executable support a "fetch many" approach when dumping large queries to stdout?
@ 2010-04-02 22:19  John Beaver <john_beaver@hms.harvard.edu>
  parent: Pierre C <lists@peufeu.com>
  1 sibling, 0 replies; 3+ messages in thread

From: John Beaver @ 2010-04-02 22:19 UTC (permalink / raw)
  To: Pierre C <lists@peufeu.com>; +Cc: pgsql-performance

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
That makes sense. I'll just use a COPY statement instead like Hannu
suggests.<br>
<br>
Pierre C wrote:
<blockquote cite="mid:op.vajyiejneorkce@immo.peufeu.com" type="cite">
  <blockquote type="cite">
    <pre wrap="">Does the psql executable have any ability to do a "fetch many", using a  
server-side named cursor, when returning results? It seems like it tries  
to retrieve the query entirely to local memory before printing to  
standard out.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I think it grabs the whole result set to calculate the display column  
widths. I think there is an option to tweak this but don't remember which,  
have a look at the psql commands (\?), formatting section.
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
John E. Beaver
Bioinformatics Developer
Harvard Medical School</pre>
</body>
</html>



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: *** PROBABLY SPAM *** Does the psql executable support a "fetch many" approach when dumping large queries to stdout?
@ 2010-04-13 02:49  Bruce Momjian <bruce@momjian.us>
  parent: Pierre C <lists@peufeu.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Bruce Momjian @ 2010-04-13 02:49 UTC (permalink / raw)
  To: Pierre C <lists@peufeu.com>; +Cc: Beaver, John E <John_Beaver@hms.harvard.edu>; pgsql-performance

Pierre C wrote:
> > Does the psql executable have any ability to do a "fetch many", using a  
> > server-side named cursor, when returning results? It seems like it tries  
> > to retrieve the query entirely to local memory before printing to  
> > standard out.
> 
> I think it grabs the whole result set to calculate the display column  
> widths. I think there is an option to tweak this but don't remember which,  
> have a look at the psql commands (\?), formatting section.

See the FETCH_COUNT variable mentioned in the psql manual page.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2010-04-13 02:49 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-04-02 20:43 Re: *** PROBABLY SPAM *** Does the psql executable support a "fetch many" approach when dumping large queries to stdout? Pierre C <lists@peufeu.com>
2010-04-02 22:19 ` John Beaver <john_beaver@hms.harvard.edu>
2010-04-13 02:49 ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox