Problem with Avg function and Money type in PostgreSQL 15

From: Erki Eessaar <erki(dot)eessaar(at)taltech(dot)ee>
To: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Problem with Avg function and Money type in PostgreSQL 15
Date: 2022-10-30 10:15:32
Message-ID: AM9PR01MB8268D033D3741B7E7B5EC13AFE349@AM9PR01MB8268.eurprd01.prod.exchangelabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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 14.5

ERROR: function avg(money) does not exist
LINE 1: SELECT Avg(price) AS av FROM Product;
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

PostgreSQL 15

ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack depth limit is adequate.
CONTEXT: SQL function "avg" during inlining
SQL function "avg" during startup
SQL function "avg" statement 1 --this line is repeated more than 3000 times

It seems to me that PostgreSQL 14.5 response is much better than in case of PostgreSQL 15.

Best regards
Erki Eessaar

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Japin Li 2022-10-30 13:52:26 Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios
Previous Message Dilip Kumar 2022-10-30 06:39:06 Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios