Re: Storing images in PostgreSQL databases (again)

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Storing images in PostgreSQL databases (again)
Дата
Msg-id b42b73150610061216h5a21f5abv25b3d6d5705feeaf@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Storing images in PostgreSQL databases (again)  (Jean-Christophe Roux <jcxxr@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: "Chris Hoover"
Дата:
Сообщение: how to get number of minutes?
Следующее
От: "Worky Workerson"
Дата:
Сообщение: Re: DELETE eats up all memory and crashes box