Re: [GENERAL] Need help requiring uniqueness in text columns

2008-01-02 Thread Pavel Stehule
On 02/01/2008, Matthew Wilson <[EMAIL PROTECTED]> wrote: > 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 UNIQ

Re: [GENERAL] Need help requiring uniqueness in text columns

2008-01-02 Thread Matthew Wilson
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'))); > > Re

Re: [GENERAL] Need help requiring uniqueness in text columns

2008-01-02 Thread Pavel Stehule
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, m

Re: [GENERAL] Need help requiring uniqueness in text columns

2008-01-01 Thread Stuart Bishop
Matthew Wilson wrote: > I have a table MESSAGE with a text column and a timestamp column. I > want to make sure that I have no rows with duplicates for both values. > I have two ideas right now for how to do this. > > IDEA 1: > > CREATE UNIQUE INDEX nodups on MESSAGE (my_timestamp_col, my_text_c