Re: Storing images as BYTEA or large objects - Mailing list pgsql-general

From Koen Vermeer
Subject Re: Storing images as BYTEA or large objects
Date
Msg-id 1202894354.5251.15.camel@localhost
Whole thread Raw
In response to Re: Storing images as BYTEA or large objects  ("Gevik Babakhani" <pgdev@xs4all.nl>)
Responses Re: Storing images as BYTEA or large objects
List pgsql-general
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


pgsql-general by date:

Previous
From: "Gevik Babakhani"
Date:
Subject: Re: Storing images as BYTEA or large objects
Next
From: "Willy-Bas Loos"
Date:
Subject: show time consumed by query in psql