Re: Unique Index

Поиск
Список
Период
Сортировка
От Dann Corbit
Тема Re: Unique Index
Дата
Msg-id D425483C2C5C9F49B5B7A41F8944154705582A@postal.corporate.connx.com
обсуждение исходный текст
Ответ на Unique Index  (Alex <alex@meerkatsoft.com>)
Список pgsql-general
Yes.
I was wrong.

Sorry about the noise.

-----Original Message-----
From: Stephan Szabo [mailto:sszabo@megazone.bigpanda.com]
Sent: Thursday, January 20, 2005 12:01 PM
To: Dann Corbit
Cc: Tom Lane; Greg Stark; pgsql-general@postgresql.org
Subject: RE: [GENERAL] Unique Index

On Thu, 20 Jan 2005, Dann Corbit wrote:

> Would the constraint not be satisfied if each combination (including
> NULL) were not also forced to be unique?

The constraint would be satisfied, however cases that the constraint is
satisfied for would not be allowed.  The case I gave below is one for
which I argue the constraint is satisfied because the search condition
is
true.  The definition above would appear to not allow that case and as
such appears to be contrary to the definition of the constraint.

> Let me also state that I agree: allowing null values in a unique index
> is ludicrous.  But if it is allowed, I think forcing the combinations
to
> be single valued makes more sense than allowing any number of them.

I think that'd be better termed a DISTINCT index to use SQL terminology.

> On Thu, 20 Jan 2005, Dann Corbit wrote:
>
> > It is clear to me that only allowing a single null value will not
> > violate the explanation below.
>
> Given two rows in T with one column each
> (NULL), (NULL)
>
> Find two rows such that the value of each column in one row is
non-null
> and equal to the value of the corresponding column in the other row
> according to 8.2. If there are no such rows the unique predicate
returns
> true (ie the constraint is satisfied).
>

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Unique Index
Следующее
От: Tino Wildenhain
Дата:
Сообщение: Re: Unique Index