Re: BUG #3965: UNIQUE constraint fails on long column values - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #3965: UNIQUE constraint fails on long column values
Date
Msg-id 8535.1203523485@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #3965: UNIQUE constraint fails on long column values  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-bugs
Gregory Stark <stark@enterprisedb.com> writes:
> "Heikki Linnakangas" <heikki@enterprisedb.com> writes:
>> Return type of hash* functions is just 32 bits. I wonder if that's wide enough
>> to avoid accidental collisions? Depends on the application of course...

> Oh, I missed that you were suggesting a UNIQUE index. That seems unsafe to me
> even for md5 or its ilk. But that would depend on the application too.

md5 is designed to be a signature, remember?  If there weren't a very
high probability of its output being different for different inputs,
it wouldn't be good for anything.

The built-in hash functions definitely cannot be relied on to not have
collisions, though.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: BUG #3965: UNIQUE constraint fails on long column values
Next
From: Tom Lane
Date:
Subject: Re: GetNewOidWithIndex can cause infinite loop on user tables(not catalog).