Re: BUG #6669: unique index w/ multiple columns and NULLs

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, jo <jose(dot)soares(at)sferacarta(dot)com>, pgsql-bugs(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: BUG #6669: unique index w/ multiple columns and NULLs
Date: 2012-06-04 21:31:01
Message-ID: 1338845461.27297.21.camel@sussancws0025
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2012-06-04 23:14:38 Re: BUG #6672: Memory leaks in dumputils.c
Previous Message Tom Lane 2012-06-04 20:33:05 Re: Calling xlst_process with certain arguments causes server crash