Re: multiple paramters in aggregate function

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема Re: multiple paramters in aggregate function
Дата
Msg-id 4A840C2B.6090309@compulab.co.il
обсуждение исходный текст
Ответ на Re: multiple paramters in aggregate function  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Ответы Re: multiple paramters in aggregate function
Список pgsql-general
> It's probably easiest to decide on an internal unit to use in your
> aggregate and only convert it to the desired unit once you're done
> summing them. I'd probably convert all measurements to mm in the
> function and summarise those.
That could work in some cases, however in our case it would not produce
desirable results. If the user put in meters, he is expecting to see
meters. My problem comes in only when the user put in values in multiple
unit types, which does not happen very often. It is generally a mistake,
but we would prefer to let them make the mistake and then see an
irrational result and correcting it, rather then telling them they
probably made a mistake.

I think Scara's solution makes the most sense. It is slightly cleaner
then using an array and comes up with the same result.

Sim

В списке pgsql-general по дате отправления:

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: 8.4.0 bug - failure to enforce a foreign key constraint
Следующее
От: Scara Maccai
Дата:
Сообщение: Re: multiple paramters in aggregate function