Re: group by true now errors with non-integer constant in GROUP BY

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: group by true now errors with non-integer constant in GROUP BY
Дата
Msg-id d5820b3a-4e0d-e8d7-130b-ce82d6509b9f@dunslane.net
обсуждение исходный текст
Ответ на Re: group by true now errors with non-integer constant in GROUP BY  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs


On 2023-08-28 Mo 15:56, Tom Lane wrote:

The bigger picture here is: what is the use-case for grouping by a
constant at all?  Assuming that it is an error seems like a good
foolproofing restriction.  The reason we felt we could keep the
"group by N" SQL92-ism after SQL99 redefined GROUP BY arguments is
exactly that there's no obvious use-case for grouping by a constant.
As soon as you allow it, "group by N" becomes hopelessly ambiguous.

So my druthers would be to reject this as a non-bug.  But if we accept
it as something to fix, we need to revisit exactly which conditions
are errors here.  Perhaps rather than "reject all non-integer cases",
we should only reject the Float case, and let others fall through to
the SQL99 code.  (I would not be happy allowing Float, because that'd
mean that "group by 4" and "group by 4.0" mean fundamentally different
things.)
			


I vote for treating it as a non-bug.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: group by true now errors with non-integer constant in GROUP BY
Следующее
От: David Rowley
Дата:
Сообщение: Re: group by true now errors with non-integer constant in GROUP BY