Skip site navigation (1) Skip section navigation (2)

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: (view raw or whole 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.


In response to

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


pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group