On Mon, 2 Nov 2020 at 09:21, Tom Lane <t...@sss.pgh.pa.us> wrote:

> Isaac Morland <isaac.morl...@gmail.com> writes:
>


> > Speaking as somebody who sometimes does really dumb things, I don’t like
> > this change in error message. The current message clearly identifies the
> > problem; the new message makes it look like there is a bug in Postgres.
>
> Neither message would be reachable without (erroneous) C hacking,
> so I don't quite buy that there's a problem.
>

OK, I must have misunderstood. I had the impression that we were talking
about just writing a query which used an aggregate function where a normal
function was needed, but on closer consideration I see I had it wrong. For
example:

odyssey=> select * from uw_term where count(*) = 1;
ERROR:  aggregate functions are not allowed in WHERE
LINE 1: select * from uw_term where count(*) = 1;
                                    ^
odyssey=>

But this is a different error message, and thinking about it putting an
aggregate in the SELECT will end up using it as an aggregate (e.g. SELECT
count(*) FROM ...).

I agree that C hackers need to know what they’re doing ;-)

Reply via email to