Re: user defined aggregate with multiple arguments

From: "Sergey E(dot) Koposov" <math(at)sai(dot)msu(dot)ru>
To: Bill Eaton <wpeaton(at)adelphia(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: user defined aggregate with multiple arguments
Date: 2006-10-12 09:55:27
Message-ID: Pine.LNX.4.64.0610121350530.14643@lnfm1.sai.msu.ru
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?
>

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: math(at)sai(dot)msu(dot)ru

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-10-12 10:26:47 Re: List of supported 64bit OS
Previous Message Martijn van Oosterhout 2006-10-12 09:47:16 Re: STABLE functions