From: Tom Lane <tgl@sss.pgh.pa.us>
To: Erki Eessaar <erki.eessaar@taltech.ee>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Problem with Avg function and Money type in PostgreSQL 15
Date: Sun, 30 Oct 2022 13:57:37 -0400
Message-ID: <241789.1667152657@sss.pgh.pa.us> (raw)
In-Reply-To: <AM9PR01MB8268D033D3741B7E7B5EC13AFE349@AM9PR01MB8268.eurprd01.prod.exchangelabs.com>
References: <AM9PR01MB8268D033D3741B7E7B5EC13AFE349@AM9PR01MB8268.eurprd01.prod.exchangelabs.com>
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 depth limit 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, erki.eessaar@taltech.ee, pgsql-bugs@lists.postgresql.org
Subject: Re: Problem with Avg function and Money type in PostgreSQL 15
In-Reply-To: <241789.1667152657@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox