Re: Aggregate function API versus grouping sets

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: Aggregate function API versus grouping sets
Date: 2014-07-03 22:58:52
Message-ID: 28782.1404428332@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> Here are two more, cumulative with the previous patch and each other:
> The first removes the assumption in ordered_set_startup that the
> aggcontext can be cached in fn_extra, and puts it in the transvalue
> instead.

OK, done. (ATM it seems like we wouldn't need gcontext in the transvalue
either, but I left it there in case we want it later.)

> The second exposes the OSA* structures in a header file, so that
> user-defined ordered-set aggs can use ordered_set_transition[_multi]
> directly rather than having to cargo-cult it into their own code.

I'm not very happy about this one; we intentionally did not expose
these structs, so that we could freely make fixes like, for example,
your immediately preceding patch.

I think it'd be worth considering whether there's a way to allow
third-party ordered-set aggs to use the infrastructure in orderedsetaggs.c
while still treating these structs as opaque. In any case we'd need a
more carefully thought-through API than just decreeing that some private
structs are now public.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Dunstan 2014-07-04 01:57:41 Re: "RETURNING PRIMARY KEY" syntax extension
Previous Message Andrew Gierth 2014-07-03 22:41:38 Re: Aggregate function API versus grouping sets