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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to