Re: Aggregate ORDER BY patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Aggregate ORDER BY patch
Дата
Msg-id 21281.1260900433@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>)
Список pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> Updated version of the aggregate order by patch.

Applied with some editorialization.  The main change I made was to get
rid of all the ad-hoc DISTINCT handling in parse_agg.c and use
transformDistinctClause() instead.  This exposed what I believe to
be a bug in the submitted patch: it accepted cases like
agg(DISTINCT x ORDER BY x,y)

We do not allow that in ordinary query-level DISTINCT because it's
ambiguous --- there might be multiple y values for any particular value
of x, so the ordering is uncertain.  The only way it's not uncertain is
if the sort by x fully determines the order, in which case listing y is
merely useless.  I think this is something that was changed not too
long ago, so maybe you were trying to emulate the old behavior, but
in any case it's better to not have extra code that doesn't behave
quite like the normal case.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: New VACUUM FULL
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Closing out CommitFest 2009-11