On Wed, 2008-02-13 at 09:57 +0100, Gevik Babakhani wrote:
> In hour case we where switching between databases so what I have done in the
> past was:
> For inserting:
> 1. create a TEXT column in my table. (In PG this can be 1GB in size)
> 2. read file contents in a buffer/string and Base64 encode that string.
> 3. write the string into db.
> For reading:
> 1. read the text column into a buffer/string Base64 decode to get your
> original image/binary data.
> The approach above worked for us. This was a PHP5 website and C# frontend.
Instead of base64 encoding, I guess it would be easier to just escape
the required bytes and store them in a bytea.
But, just to be clear: I think I can get both methods (lo or bytea) to
work. All I was trying to find out is which option would be better in my
case.
Best,
Koen