Re: bytea and text

From: Brian Modra <epailty(at)googlemail(dot)com>
To: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: bytea and text
Date: 2009-11-26 14:52:15
Message-ID: 5a9699850911260652j6c9d23b5nf5d5f587db4d4130@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

2009/11/26 Jean-Yves F. Barbier <12ukwn(at)gmail(dot)com>:
> 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,

I have not looked into what the internal representation is with BYTEA,
but if it is binary, then it will be more efficient than text and
base64.

> * using a TEXT column type, and store a Base64(picture) in it; it should
>   take benefits of intrinsic compression (?).

One disadvantage of BYTEA is that if you use the escaped format to
insert, then you can hit the limit of SQL size. This limit would not
be quite as tight if you use base64.

If this is the case though, I wonder why base64 isn't an option for
the escaped syntax for BYTEA?

>
> JY
> --
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>

--
Brian Modra Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2009-11-26 15:58:01 Re: bytea and text
Previous Message Jean-Yves F. Barbier 2009-11-26 14:44:58 bytea and text