Обсуждение: MAX(ROW(...)) - feature request

Поиск
Список
Период
Сортировка

MAX(ROW(...)) - feature request

От
"Dědek Ondřej"
Дата:
Hello. Since release 8.2 row comparisons work well - thanks! It would be nice if MIN and MAX aggregate functions could
operateon row values, so I could write in SQL: 

SELECT MIN(ROW(a, b, c, d)) FROM table

to find extreme value of ordered set of columns. It should not be hard to implement, please.

I'm looking forward to release 8.4 which will introduce window functions.

Re: MAX(ROW(...)) - feature request

От
Grzegorz Jaśkiewicz
Дата:
least()
greatest().

Re: MAX(ROW(...)) - feature request

От
Merlin Moncure
Дата:
2009/3/25 Grzegorz Jaśkiewicz <gryzman@gmail.com>:
> least()
> greatest().

Actually, these answer a different question, OP is interested in using
aggregate on composite type...

merlin

Re: MAX(ROW(...)) - feature request

От
Grzegorz Jaśkiewicz
Дата:
2009/3/25 Merlin Moncure <mmoncure@gmail.com>:

> Actually, these answer a different question, OP is interested in using
> aggregate on composite type...

true, I was too quick ... :)



--
GJ

Re: MAX(ROW(...)) - feature request

От
Sam Mason
Дата:
On Wed, Mar 25, 2009 at 12:50:01PM -0400, Merlin Moncure wrote:
> 2009/3/25 Grzegorz Jaśkiewicz <gryzman@gmail.com>:
> > least()
> > greatest().
>
> Actually, these answer a different question, OP is interested in using
> aggregate on composite type...

I think Grzegorz was pointing out (rather too tersely in my opinion)
that it would be nice if these were supported as well.  E.g.

  CREATE TABLE foo ( i INT );
  SELECT least('(1)'::foo,NULL);

results in an error.  When this should be valid.

--
  Sam  http://samason.me.uk/