Re: WITHIN GROUP patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WITHIN GROUP patch
Date
Msg-id 14280.1386448399@sss.pgh.pa.us
Whole thread Raw
In response to Re: WITHIN GROUP patch  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: WITHIN GROUP patch
List pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>  Tom> I believe that the spec requires that the "direct" arguments of
>  Tom> an inverse or hypothetical-set aggregate must not contain any
>  Tom> Vars of the current query level.

> False.

After examining this more closely, ISTM that the direct arguments are
supposed to be processed as if they weren't inside an aggregate call at all.
That being the case, isn't it flat out wrong for check_agg_arguments()
to be examining the agg_ordset list?  It should ignore those expressions
whilst determining the aggregate's semantic level.  As an example, an
upper-level Var in those expressions isn't grounds for deciding that the
aggregate isn't of the current query level.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: ANALYZE sampling is too good
Next
From: Tom Lane
Date:
Subject: Re: Index overhead cost reporting