Re: user defined aggregate with multiple arguments

From: Bill Eaton <wpeaton(at)adelphia(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: user defined aggregate with multiple arguments
Date: 2006-10-13 05:13:59
Message-ID: 452F2097.6070202@adelphia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On Wed, 11 Oct 2006, Bill Eaton wrote:
>>
>> I just notice that multiple inputs to aggregates are allowed in the
>> upcoming 8.2 release. This gives me a great incentive to play with
>> the beta and upgrade from 8.0.
>>
>> One question remains: how about multiple outputs? Can I have a ROW as
>> a return value -- i.e. something like SLOPE and INTERCEPT in the
>> original example?
>>
> Sergey E. Koposov wrote:
> First, you don't have to write these functions by yourself. The
> functions for least squares fit are defined in the standart, and they
> will be also in 8.2.
> http://momjian.us/main/writings/pgsql/sgml/functions-aggregate.html
>
> But, in any way, if you want your aggregate to return several values,
> you can always return them as the elements in the array.
Actually, I was wanting to do higher order polynomial fits. But it's
cool that there are some new functions. So you suggest I use an array as
a return type. Hmm. Never did much with arrays before. So that means a
"row" or "setof" is not an option?

-Bill

In response to

Browse pgsql-general by date

  From Date Subject
Next Message roopa perumalraja 2006-10-13 05:26:28 Performance Problem
Previous Message roopa perumalraja 2006-10-13 05:13:48 Performance problem