Re: Unique Index

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unique Index
Date: 2005-01-20 21:00:20
Message-ID: 1106254820.4014.100.camel@Andrea.peacock.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Donnerstag, den 20.01.2005, 06:09 -0800 schrieb J. Greenlees:
> Tino Wildenhain wrote:
> > Hi,
> >
> > Am Mittwoch, den 19.01.2005, 15:02 -0800 schrieb J. Greenlees:
> >
> >>Roman Neuhauser wrote:
> >>
> >>># alex(at)meerkatsoft(dot)com / 2005-01-20 01:35:32 +1100:
> >>>
> >>>
> >>>>i have a unique index on a table over multiple columns. If now one of
> >>>>the records has a null value in one of the indexed columns i can insert
> >>>>the same record multiple times.
> >>>>
> >>>>Is this a problem within postgres or expected?
> >>>
> >>>
> >>> In SQL, NULL means "unknown value". How could you assert that two
> >>> NULLs are equal?
> >>>
> >>
> >>which doesn't make mathematical sense.
> >>mathwise null is an empty result.
> >>so setting the logic up using the math logic, null values are always equal.
> >
> >
> > What kind of mathematics you are speaking?
> > For example you have "infinity" where infinity is never
> > equal to infinity.
> > Same with null. Which is "unknown" or "undefined"
> > So if x is undefined and y is undefined you cannot
> > assume x=y - because if you assume this, then
> > they would not be undefined anymore.
> >
> > q.e.d.
> >
> > Regards
> > Tino
> >
> >
> or null as in empty.
> an empty result set is a null set, zero results.
> declare a variable, but never assign a value, it has a default value of
> null from the declaration.
> ( basically any content of memory space allocated that was not actually
> empty is the content, but it's a null value to the app. )

No. Empty result set is just a set without elements. zero-length
list or tuple or whatever your programming language uses :-)

[] != null/undefined/None

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-01-20 21:06:15 Re: Client's variables
Previous Message Dann Corbit 2005-01-20 20:03:27 Re: Unique Index