pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Allardyce <dave@pod13.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Table Constraints with NULL values
Date: Fri, 19 Oct 2001 23:51:37 -0400
Message-ID: <11619.1003549897@sss.pgh.pa.us> (raw)
In-Reply-To: <045b01c1590c$f3751220$6100a8c0@pod13.com>
References: <026601c15849$b4f38680$6100a8c0@pod13.com>
	<11522.1003474419@sss.pgh.pa.us>
	<045b01c1590c$f3751220$6100a8c0@pod13.com>

"David Allardyce" <dave@pod13.net> writes:
> ... If they had defined uniqueness as "all rows
> must be distinct" then two all null rows would violate the uniqueness
> constraint.  Not the behavior I want at all.

Er, why not?  You're essentially arguing that the UNIQUE constraint
should treat nulls as equal, so I'd think two all-null rows should be
considered equal too.  I do not see how you can consistently maintain
that (x,NULL) equals (x,NULL) but (NULL,NULL) doesn't equal (NULL,NULL).

But we have been around the maypole on this question several times
before, with no permanent resolution --- the plain fact is that the
spec isn't very clearly written.  Useful data would be tests
demonstrating how other systems (Oracle, DB2, etc) interpret the issue.

			regards, tom lane



view thread (4+ messages)

Message-ID: <11619.1003549897@sss.pgh.pa.us>
Permalink:  ../11619.1003549897@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11619.1003549897@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dave@pod13.net
  Subject: Re: Table Constraints with NULL values
  In-Reply-To: <11619.1003549897@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox