On Wed, 15 Oct 2003, Edmund Dengler wrote:
> Note that as a prime example of how postgresql itself is not "consistent"
> (in the strictest sense) is GROUP BY which treats NULL == NULL
> (interesting side bar, is there a way to cause GROUP BY to treat NULLs as
> not equal to each other?). In a theoretical question, how is this
> justified if NULL should not equal to NULL (other than "it is in the
> spec")?
Because it's not defined in terms of equality. ;) GROUP BY is defined by
value "distinct"ness, where distinct has a very specific definition in the
spec (which treats two NULL values as not distinct).
You might actually be able to find some way to use that to your advantage,
but I'm not sure how.