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?


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.

Regards,
        Sergey

*******************************************************************
Sergey E. Koposov
Max Planck Institute for Astronomy/Sternberg Astronomical Institute
Tel: +49-6221-528-349
Web: http://lnfm1.sai.msu.ru/~math
E-mail: [EMAIL PROTECTED]

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to