Re: bytea and text - Mailing list pgsql-novice

From Brian Modra
Subject Re: bytea and text
Date
Msg-id 5a9699850911260652j6c9d23b5nf5d5f587db4d4130@mail.gmail.com
Whole thread Raw
In response to bytea and text  ("Jean-Yves F. Barbier" <12ukwn@gmail.com>)
List pgsql-novice
2009/11/26 Jean-Yves F. Barbier <12ukwn@gmail.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@postgresql.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/

pgsql-novice by date:

Previous
From: "Jean-Yves F. Barbier"
Date:
Subject: bytea and text
Next
From: Tom Lane
Date:
Subject: Re: bytea and text