|
Posted by Kenneth Downs on 08/18/05 01:22
bissatch@yahoo.co.uk wrote:
>> $base64 = base64_encode($binary);
>
> Is this a similar idea to using pg_escape_bytea? Is the above better in
> any way?
Yes, it is similar.
The advantage that the bytea type has, and the corresponding function
pg_escape_bytea, is that the storage requirements are only 75% of what is
required for the base64-encoded type.
However, the bytea-encoded data must be decoded when you get it back from
the server, and if you are going to attach it to an email you have to
base64 encode it, so it gets handled twice going out to a browser or email
program. So I pay the price in storage to save the base64 to disk so I can
read it off the disk and send it over the wire without processing it at
all.
--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Navigation:
[Reply to this message]
|