pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Zoltan Boszormenyi <zboszor@dunaweb.hu>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [PERFORM] psql -A (unaligned format) eats too much memory
Date: Mon, 05 Jun 2006 12:00:35 -0400
Message-ID: <20813.1149523235@sss.pgh.pa.us> (raw)
In-Reply-To: <20060605155349.GU53487@pervasive.com>
References: <44835834.2020309@dunaweb.hu>
	<44835F86.5040008@dunaweb.hu>
	<20060605152258.GT53487@pervasive.com>
	<20512.1149521250@sss.pgh.pa.us>
	<20060605155349.GU53487@pervasive.com>

"Jim C. Nasby" <jnasby@pervasive.com> writes:
> On Mon, Jun 05, 2006 at 11:27:30AM -0400, Tom Lane wrote:
>> I'm reading this as just another uninformed complaint about libpq's
>> habit of buffering the whole query result.  It's possible that there's
>> a memory leak in the -A path specifically, but nothing said so far
>> provided any evidence for that.

> Certainly seems like it. It seems like it would be good to allow for
> libpq not to buffer, since there's cases where it's not needed...

See past discussions.  The problem is that libpq's API says that when it
hands you back the completed query result, the command is complete and
guaranteed not to fail later.  A streaming interface could not make that
guarantee, so it's not a transparent substitution.

I wouldn't have any strong objection to providing a separate API that
operates in a streaming fashion, but defining it is something no one's
bothered to do yet.  In practice, if you have to code to a variant API,
it's not that much more trouble to use a cursor...

			regards, tom lane



view thread (6+ messages)

Message-ID: <20813.1149523235@sss.pgh.pa.us>
Permalink:  ../20813.1149523235@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20813.1149523235@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jnasby@pervasive.com, zboszor@dunaweb.hu, pgsql-hackers@postgresql.org
  Subject: Re: [PERFORM] psql -A (unaligned format) eats too much memory
  In-Reply-To: <20813.1149523235@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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