Re: Bug in 9.0Alpha4 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in 9.0Alpha4
Date
Msg-id 13490.1268769361@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in 9.0Alpha4  (Gokulakannan Somasundaram <gokul007@gmail.com>)
Responses Re: Bug in 9.0Alpha4
Re: Bug in 9.0Alpha4
List pgsql-hackers
Gokulakannan Somasundaram <gokul007@gmail.com> writes:
>> transformSortClause is passed the untransformed aggorder list, which is
>> in fact a list of SortBy nodes, and it returns the transformed list
>> (SortGroupClause nodes), which is stored back into the aggorder field
>> a bit further down.

> Right Tom.  I got confused, because the comment at Aggref struct definition
> told that it is a list of SortGroupClause. May be you can update your
> comments there.

I think that comment is fine.  The reason this is confusing is that
ParseFuncOrColumn uses the Aggref node to carry a couple of things
that logically are input parameters to transformAggregateCall().
Although this affects nothing else and is commented at both ends,
apparently it's confusing anyway.

When we were doing the ordered-aggregates patch, I considered passing
all those values as explicit parameters to transformAggregateCall,
and having it build the Aggref node from scratch and return it.
However having seven or eight parameters to transformAggregateCall
(and more in future if we ever add more features here) didn't really
seem to be better style than abusing Aggref a bit.  But maybe it is
the best way after all.  Thoughts?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: parametrized NOTIFY - issue in plpgsql, maybe ToDo
Next
From: Florian Pflug
Date:
Subject: Re: Dyamic updates of NEW with pl/pgsql