Re: Ordering behavior for aggregates

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: Ordering behavior for aggregates
Дата
Msg-id 52ca6930-fd6e-8eb5-2dae-e45fadd43222@postgresfriends.org
обсуждение исходный текст
Ответ на Re: Ordering behavior for aggregates  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 12/13/22 18:22, Tom Lane wrote:
> "David G. Johnston" <david.g.johnston@gmail.com> writes:
>> I'm more keen on the idea of having the system understand when an ORDER BY
>> is missing - that seems like what users are more likely to actually do.
> 
> That side of it could perhaps be useful, but not if it's an unintelligent
> analysis.  If someone has a perfectly safe query written according to
> the old-school method:
> 
>     SELECT string_agg(...) FROM (SELECT ... ORDER BY ...) ss;
> 
> they are not going to be too pleased with a nanny-ish warning (much
> less an error) saying that the aggregate's input ordering is
> underspecified.

That is a good point

> I also wonder whether we'd accept any ORDER BY whatsoever, or try
> to require one that produces a sufficiently-unique input ordering.

I would accept anything.  agg(x order by y) is a common thing.

-- 
Vik Fearing




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

Предыдущее
От: Jacob Champion
Дата:
Сообщение: Re: Remove SHA256_HMAC_B from scram-common.h
Следующее
От: Ilya Gladyshev
Дата:
Сообщение: Re: Progress report of CREATE INDEX for nested partitioned tables