Re: BYTEA or LO?

From: "ktm(at)rice(dot)edu" <ktm(at)rice(dot)edu>
To: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: BYTEA or LO?
Date: 2011-05-31 18:40:02
Message-ID: 20110531184002.GF8700@staff-mud-56-27.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, May 31, 2011 at 07:09:23PM +0200, Jean-Yves F. Barbier wrote:
> Hi list,
>
> I need to read/write pictures to my DB and I wonder which column type
> would be the best? (and DON'T feed the troll: I won't put them onto the FS),
> client will be written in Python.
>
> I formerly tested BYTEA (7.dontremember) and found that I needed to transcode
> my pictures into Base64 format to be able to do so (long and add 33% to the
> size); this is what I'd like to avoid.
>

That is needed to use the non-binary API. You can also use hex encoding starting
with 9.0, I think. The data is stored in binary internally so you should not get
a 33% bump in size. If you use the binary API, you can avoid the hex/base64
encoding pass as well.

Regards,
Ken

In response to

  • BYTEA or LO? at 2011-05-31 17:09:23 from Jean-Yves F. Barbier

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jean-Yves F. Barbier 2011-05-31 19:01:26 Re: BYTEA or LO?
Previous Message Jean-Yves F. Barbier 2011-05-31 17:09:23 BYTEA or LO?