Mircea Sarbu wrote:
> There are some hidden drawbacks for this approach? (I don't need any further
> processing on the binary content)
>
There are people who have reported using this method successfully on the
Postgres lists. Only downsides I can think of are:
1) You have to encode to base64 on the way in (bytea has to be escaped
on INSERT/UPDATE too)
2) You have to decode to binary on the way out (depending on your
middleware, you can use a binary cursor for bytea and avoid the
decode on SELECT)
3) The on disk representation is about 33% bigger compared to bytea
4) TEXT datatype is subject to being multibyte encoded -- I don't think
this affects the characters in the base64 set, but I'm not sure there
won't be any undesireable interactions. If you are using other than
'C' locale, test carefully.
Joe