Re: BYTEA or LO? - Mailing list pgsql-novice

From ktm@rice.edu
Subject Re: BYTEA or LO?
Date
Msg-id 20110531184002.GF8700@staff-mud-56-27.rice.edu
Whole thread Raw
In response to BYTEA or LO?  ("Jean-Yves F. Barbier" <12ukwn@gmail.com>)
Responses Re: BYTEA or LO?  ("Jean-Yves F. Barbier" <12ukwn@gmail.com>)
List 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

pgsql-novice by date:

Previous
From: "Jean-Yves F. Barbier"
Date:
Subject: BYTEA or LO?
Next
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: BYTEA or LO?