Re: Getting rid of aggregate_dummy() - Mailing list pgsql-hackers

From Isaac Morland
Subject Re: Getting rid of aggregate_dummy()
Date
Msg-id CAMsGm5cMQwh9uUmypvVE78VQ0C2Y0QOkU8h4NW5+oCZ-gNEJVQ@mail.gmail.com
Whole thread Raw
In response to Re: Getting rid of aggregate_dummy()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 2 Nov 2020 at 09:21, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Isaac Morland <isaac.morland@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 ;-)

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Disable WAL logging to speed up data loading
Next
From: Stephen Frost
Date:
Subject: Re: public schema default ACL