Re: Need help requiring uniqueness in text columns

Поиск
Список
Период
Сортировка
От Matthew Wilson
Тема Re: Need help requiring uniqueness in text columns
Дата
Msg-id slrnfnnacd.dk.matt@coleridge.tplus1.com
обсуждение исходный текст
Ответ на Need help requiring uniqueness in text columns  (Matthew Wilson <matt@tplus1.com>)
Ответы Re: Need help requiring uniqueness in text columns  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-general
On Wed 02 Jan 2008 04:23:46 AM EST, Pavel Stehule wrote:
> Hello
>
> IDEA 3:
>
> Use two hash functions:
>
> CREATE UNIQUE INDEX uidx ON TEST((decode(md5(a),'hex')),(hashtext(a)));
>
> removing spaces helps
> CREATE UNIQUE INDEX uidx ON test((decode(md5(lower(replace(a,' ',''))),'hex')));
>
> Regards
> Pavel Stehule
>
> CREATE UNIQUE INDEX nodups on MESSAGE (my_timestamp_col, md5(my_text_col));

What is the advantage of this method?

--
Programming, economics, gardening, life in Cleveland.
http://blog.tplus1.com

В списке pgsql-general по дате отправления:

Предыдущее
От: "William Temperley"
Дата:
Сообщение: Creating XML/KML documents from single tables
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Need help requiring uniqueness in text columns