Thread: Re: min,max aggregate functions

Re: min,max aggregate functions

From
Tom Lane
Date:
Oleg Bartunov <oleg@sai.msu.su> writes:
> AFAIK, it's required to write min(),max() aggregate functions for
> user-defined types even if compare function is already defined for
> this type. Is't possible to get these functions working for
> such user-defined types automatically ?

Doesn't really seem worth the trouble.  We'd need some sort of notion
of a generic aggregate function; and even then, you'd have to tell the
system what comparison function to use for your datatype.
        regards, tom lane


Re: min,max aggregate functions

From
Oleg Bartunov
Date:
On Wed, 27 Feb 2002, Tom Lane wrote:

> Oleg Bartunov <oleg@sai.msu.su> writes:
> > AFAIK, it's required to write min(),max() aggregate functions for
> > user-defined types even if compare function is already defined for
> > this type. Is't possible to get these functions working for
> > such user-defined types automatically ?
>
> Doesn't really seem worth the trouble.  We'd need some sort of notion
> of a generic aggregate function; and even then, you'd have to tell the
> system what comparison function to use for your datatype.

I was just curious. It's always possible to use 'order by desc limit 1'
for max() function.

So, nobody is working on aggregates.


>
>             regards, tom lane
>
Regards,    Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83