Re: WITHIN GROUP patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WITHIN GROUP patch
Date
Msg-id 21371.1386369701@sss.pgh.pa.us
Whole thread Raw
In response to Re: WITHIN GROUP patch  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> The patch as submitted answers those questions as follows:

> CREATE AGGREGATE func(integer) WITHIN GROUP (text) ...

You've glossed over a significant amount of complexity, as shown by your
example that prints WITHIN GROUP (*), a syntax that you've not defined
here.

In the long run we might think it worthwhile to actually store two
separate arglists for ordered-set aggregates; probably, pg_proc.proargs
would just describe the direct arguments and there'd be a second oidvector
in pg_aggregate that would describe the ORDER BY arguments.  This'd let
them be independently VARIADIC, or not.  I'm not proposing we do that
right now, because we don't have any use-cases that aren't sufficiently
handled by the hack of letting a single VARIADIC ANY entry cover both sets
of arguments.  I'd like though that the external syntax not be something
that prevents that from ever happening, and I'm afraid that this (*)
business is cheating enough to be a problem.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: WITHIN GROUP patch
Next
From: Andrew Gierth
Date:
Subject: Re: WITHIN GROUP patch