Re: Memory efficient insertion/retrieval of bytea

From: Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Memory efficient insertion/retrieval of bytea
Date: 2006-09-20 15:07:32
Message-ID: 20060920150731.GJ30944@batory.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 20 Sep 2006, Tom Lane wrote:

> Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl> writes:
> > Now for inserting data to a bytea we need 5*data_size in a buffer for
> > escaped data representation. 6*data_size if we do PQescapeByteaConn
> > in one chunk.
>
> If you send the value as an out-of-line binary parameter then you don't
> need any of that. See PQexecParams.

Nice. I've overlooked this.

This still needs 1*data_size for a buffer though. Much better but
sometimes not enough.

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
Winnie the Pooh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2006-09-20 15:10:56 Re: postgresql rising
Previous Message Jack Orenstein 2006-09-20 15:02:46 Re: Initializing Datums for use with SPI_execute_plan