pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jo <jose.soares@sferacarta.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-bugs@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: BUG #6669: unique index w/ multiple columns and NULLs
Date: Tue, 05 Jun 2012 09:16:22 +0200
Message-ID: <4FCDB246.6080001@sferacarta.com> (raw)
In-Reply-To: <1338845461.27297.21.camel@sussancws0025>
References: <E1SZxsy-0001GO-JW@wrigleys.postgresql.org>
	<2870.1338521291@sss.pgh.pa.us>
	<4FC86818.4080002@sferacarta.com>
	<20120604150552.GB2352@momjian.us>
	<4FCC8E020200002500048003@gw.wicourts.gov>
	<20120604155623.GD2352@momjian.us>
	<1338845461.27297.21.camel@sussancws0025>

Jeff Davis wrote:
> On Mon, 2012-06-04 at 11:56 -0400, Bruce Momjian wrote:
>   
>> I get your point about COUNT(*) really counting rows, not values, but
>> why doesn't GROUP BY then skip nulls?
>>     
>
> A while ago, I came to the conclusion that applying logic to extrapolate
> the behavior of NULL is a bad idea:
>
> http://thoughts.davisjeff.com/2009/08/02/what-is-the-deal-with-nulls/
>
> Jose was not wrong about the inconsistency between UNIQUE and GROUP BY.
> But the answer is that "we do it that way because the standard says so".
> And that's a good reason.
>
> Regards,
> 	Jeff Davis
>
>
>   
The article pointed by Jeff is very insightful.

NULLs, if you know them, avoid them :-(

I agree with Date and Darwen about NULLs:

"Chris Date and  Hugh Darwen the authors of The Third Manifesto, have 
suggested that the SQL Null implementation is inherently flawed and 
should be ELIMINATED altogether^ 
<http://en.wikipedia.org/wiki/Null_%28SQL%29#cite_note-3rdmanifesto-16; 
, pointing to inconsistencies and flaws in the implementation of SQL 
Null-handling (particularly in aggregate functions) as proof that the 
entire concept of Null is flawed and should be removed from the 
relational model"

j





view thread (11+ messages)

Message-ID: <4FCDB246.6080001@sferacarta.com>
Permalink:  ../4FCDB246.6080001@sferacarta.com/
Also on:    postgresql.org/message-id/4FCDB246.6080001@sferacarta.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: jose.soares@sferacarta.com, pgsql@j-davis.com, bruce@momjian.us, Kevin.Grittner@wicourts.gov, tgl@sss.pgh.pa.us
  Subject: Re: BUG #6669: unique index w/ multiple columns and NULLs
  In-Reply-To: <4FCDB246.6080001@sferacarta.com>
  References: <E1SZxsy-0001GO-JW@wrigleys.postgresql.org> <2870.1338521291@sss.pgh.pa.us> <4FC86818.4080002@sferacarta.com> <20120604150552.GB2352@momjian.us> <4FCC8E020200002500048003@gw.wicourts.gov> <20120604155623.GD2352@momjian.us> <1338845461.27297.21.camel@sussancws0025> <4FCDB246.6080001@sferacarta.com>

* 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