Re: group by can use alias from select list but not the having clause

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: hape Hape <postgres-hape(at)gmx(dot)de>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: group by can use alias from select list but not the having clause
Date: 2023-07-03 13:41:46
Message-ID: CAKFQuwZ3c4gqSFPXTLFDqQpe0roWQtq0Gt4_6noNgAa2bUbqqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Monday, July 3, 2023, hape Hape <postgres-hape(at)gmx(dot)de> wrote:

>
> a) the group by also doesn't know about otto
>
>
>
The isn’t a bug as we explicitly document our deviation from the standard
for group by. You are correct that you are better off not using output
column aliases in the group by specification. But we are not going to make
doing so,an error and break countless applications relying upon the
documented behavior. But we are also not going to double-down and allow
the undesirable deviation for having.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message liu zhilong 2023-07-03 13:51:27 回复: BUG #18011: Declarative partition privilege problem cause incorrect execution plans
Previous Message hubert depesz lubaczewski 2023-07-03 12:58:07 Re: Backend handling replication slot stuck using 100% cpu, unkillable