Re: group by can use alias from select list

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: group by can use alias from select list
Дата
Msg-id 1591985.1694044890@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: group by can use alias from select list  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: group by can use alias from select list  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-docs
Bruce Momjian <bruce@momjian.us> writes:
> On Tue, Jul 11, 2023 at 07:31:26AM -0700, David G. Johnston wrote:
>> I think the complaint is that someone seeing the behavior in the wild comes to
>> this order-of-operations and doesn't see that the observed behavior is
>> documented.

> How is the attached patch?

Maybe better "Although query output columns are nominally computed in the
next step, they can also be referenced (by name or by ordinal number)
as <literal>GROUP BY</literal> elements".

You could go further and add "Such references cannot be parts of
<literal>GROUP BY</literal> expressions, however."  Not sure if we
cover that explicitly anywhere else.

            regards, tom lane



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: group by can use alias from select list
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: group by can use alias from select list