Re: NULL-handling in aggregate(DISTINCT ...) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: NULL-handling in aggregate(DISTINCT ...)
Date
Msg-id 12111.1257990014@sss.pgh.pa.us
Whole thread Raw
In response to NULL-handling in aggregate(DISTINCT ...)  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: NULL-handling in aggregate(DISTINCT ...)
List pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> Now the question: If the limit of one argument for DISTINCT aggs were
> removed (which I'm considering doing as part of an update to the
> aggregate ORDER BY patch I posted a while back), what should be the
> behaviour of agg(distinct x,y) where one or both of x or y is null?
> And should it depend on the strictness of the transition function?

I think you could probably just change it: make DISTINCT work as per
regular DISTINCT (treat null like a value, keep one copy).  All the
spec-conforming aggregates are strict and would ignore the null in the
next step anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: NULL-handling in aggregate(DISTINCT ...)
Next
From: Robert Haas
Date:
Subject: Re: Unpredictable shark slowdown after migrating to 8.4