Re: Storing images in PostgreSQL databases (again) - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Storing images in PostgreSQL databases (again)
Date
Msg-id b42b73150610061216h5a21f5abv25b3d6d5705feeaf@mail.gmail.com
Whole thread Raw
In response to Re: Storing images in PostgreSQL databases (again)  (Jean-Christophe Roux <jcxxr@yahoo.com>)
List pgsql-general
On 10/5/06, Jean-Christophe Roux <jcxxr@yahoo.com> wrote:
>
> Why would I set a bytea column (containing picures) as a primary key?
> Because I want to be sure that the same image is inserted only once (that
> requirement comes from a real project) and using a primary key for that
> purpose makes sense to me.
> Am I going to retrieve an image row by its image data? I would certainly
> like! For instance, I would like to get the pictures whose main color is
> green (requirement from a real project), and a
> select * from images where main_color(image) = 'green' would be nice.
> JCR

standard postgresql indexes use a btree which would be completely
impractical to index bitmaps.  what you would want is a hand rigged
unqiue constraint which is combination of insert trigger and hash
algorithm plus some code to resolve collisions.  this is what i would
do if bitmaps were stored in/out of the database.

merlin

pgsql-general by date:

Previous
From: "Chris Hoover"
Date:
Subject: how to get number of minutes?
Next
From: "Worky Workerson"
Date:
Subject: Re: DELETE eats up all memory and crashes box