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

Re: bytea and text

From: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
To: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: bytea and text
Date: 2009-11-27 14:18:54
Message-ID: 4B0FDFCE.8080306@gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Jasen Betts a écrit :
> On 2009-11-26, Jean-Yves F. Barbier <12ukwn(at)gmail(dot)com> wrote:
>> Hi list,
>>
>> I'm asking myself what solution for storing pictures is the best:
>>
>> * using a BYTEA column type, and having no intrinsic compression gain 
>>    because a picture it almost every time already compressed,
>>
>> * using a TEXT column type, and store a Base64(picture) in it; it should
>>    take benefits of intrinsic compression (?).
> 
> use bytea and convert to/from base64 if you can't use the binary
> interface and find the text interface inconvenient.

that's what I do now
 
> this will make the data over 1/3 bigger.

uuu, na: it comes as Base64 (to avoid a 0x89 unknown utf8 char error), but it
is converted to BYTEA as I now use decode('inparm', 'base64') before insert,
as back to Base64 when I extract it (with encode).

-- 
* JHM wonders what Joey did to earn "I'd just like to say, for the record,
  that Joey rules."
		-- Seen on #Debian

In response to

pgsql-novice by date

Next:From: Jean-Yves F. BarbierDate: 2009-11-27 14:21:03
Subject: Re: index speed-up and automatic tables/procedures creation
Previous:From: Thom BrownDate: 2009-11-27 11:12:09
Subject: Re: How best to index foreign key for inner join

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