| От | Jan Kohnert |
|---|---|
| Тема | Implementing product-aggregate |
| Дата | |
| Msg-id | 2176491.irdbgypaU6@kohni-mobil обсуждение исходный текст |
| Ответы |
Re: Implementing product-aggregate
|
| Список | pgsql-general |
Hi,
we need a product aggregate and used to implement this as
exp(sum(ln([COLUMN])))
While using the sum of logarithms is working RDBMS-independently, we'd like to switch to a more PostgreSQL native way of doing this and implement an aggregate to be used. Currently the implementation is
create aggregate prod(numeric) (sfunc = numeric_mul, stype = numeric)
This is simply calling the implementation funtion of the *-Operator for the numeric datatype. Since I could not find any documentation of this implementation function, I am wondering, if using a possibly internal function might be a bad idea.
Are there any recommendations on this?
Thanks for any input!
--
MfG Jan
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера