Aggregate ORDER BY patch
От
Andrew Gierth
Тема
Aggregate ORDER BY patch
Дата
Msg-id
87tywzqi13.fsf@news-spur.riddles.org.uk
Список
Дерево обсуждения
Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Peter Eisentraut <peter_e@gmx.net>
Re: Aggregate ORDER BY patch Tom Lane <tgl@sss.pgh.pa.us>
Re: Aggregate ORDER BY patch Peter Eisentraut <peter_e@gmx.net>
Re: Aggregate ORDER BY patch Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: Aggregate ORDER BY patch Greg Stark <gsstark@mit.edu>
Re: Aggregate ORDER BY patch Tom Lane <tgl@sss.pgh.pa.us>
Re: Aggregate ORDER BY patch Peter Eisentraut <peter_e@gmx.net>
Re: Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Tom Lane <tgl@sss.pgh.pa.us>
Re: Aggregate ORDER BY patch Greg Stark <gsstark@mit.edu>
Re: Aggregate ORDER BY patch Hitoshi Harada <umi.tanuki@gmail.com>
Re: Aggregate ORDER BY patch Andres Freund <andres@anarazel.de>
Re: Aggregate ORDER BY patch Robert Haas <robertmhaas@gmail.com>
Re: Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Hitoshi Harada <umi.tanuki@gmail.com>
Re: Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Hitoshi Harada <umi.tanuki@gmail.com>
Re: Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Greg Stark <gsstark@mit.edu>
Re: Aggregate ORDER BY patch Hitoshi Harada <umi.tanuki@gmail.com>
Re: Aggregate ORDER BY patch Tom Lane <tgl@sss.pgh.pa.us>
Re: Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Tom Lane <tgl@sss.pgh.pa.us>
Re: Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Aggregate ORDER BY patch Hitoshi Harada <umi.tanuki@gmail.com>
Herewith a patch to implement agg(foo ORDER BY bar) with or without DISTINCT, etc. No artificial restrictions are imposed on what syntactical combinations are allowed. However, ORDER BY is not allowed with aggregates used as window functions (as per the existing restriction on DISTINCT). Included are regression tests but not docs yet, those will follow shortly in a separate patch (to save having to keep redoing the code patch like last time). Caveat: as discussed earlier, this patch changes the behaviour of array_agg(DISTINCT x) when applied to NULL inputs. Formerly, the NULLs were unconditionally skipped; now, they are treated just like DISTINCT or GROUP BY normally do. The previous restriction of agg(DISTINCT ...) to single-argument aggregates is removed. However, there is still a separate code path for aggregates that use DISTINCT or ORDER BY with only one input column, for performance reasons. If a non-default ordering operator is used in combination with DISTINCT, then the notion of "equality" used for the DISTINCT comparisons is the one that belongs to the ordering, rather than the default. -- Andrew.
В списке pgsql-hackers по дате отправления