Re: Problem with Avg function and Money type in PostgreSQL 15

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with Avg function and Money type in PostgreSQL 15
Дата
Msg-id 241789.1667152657@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem with Avg function and Money type in PostgreSQL 15  (Erki Eessaar <erki.eessaar@taltech.ee>)
Ответы Re: Problem with Avg function and Money type in PostgreSQL 15
Список pgsql-bugs
Erki Eessaar <erki.eessaar@taltech.ee> writes:
> CREATE TABLE Product(product_id SERIAL PRIMARY KEY,
> price MONEY NOT NULL);

> INSERT INTO Product(price) VALUES (30);
> INSERT INTO Product(price) VALUES (40);

> SELECT Avg(price) AS av FROM Product;

> PostgreSQL 15

> ERROR:  stack depth limit exceeded
> HINT:  Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack
depthlimit is adequate. 
> CONTEXT:  SQL function "avg" during inlining


I get "function avg(money) does not exist" in all branches.
Judging from the mention of a SQL function, you must have
created a not-very-well-thought-out SQL function named "avg",
and that function is recursing till stack overflow.

            regards, tom lane



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

Предыдущее
От: Lauri Laanmets
Дата:
Сообщение: Memory leak on subquery as scalar operand
Следующее
От: Erki Eessaar
Дата:
Сообщение: Re: Problem with Avg function and Money type in PostgreSQL 15