Tom,

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 ?

	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


Wed, 27 Feb 2002 20:44:15 +0300 (GMT)
Oleg Bartunov <oleg@sai.msu.su>
min,max aggregate functions
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

Wed, 27 Feb 2002 12:47:27 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: min,max aggregate functions 
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


Wed, 27 Feb 2002 20:52:13 +0300 (GMT)
Oleg Bartunov <oleg@sai.msu.su>
Re: min,max aggregate functions 