ERROR: stack depth limit exceeded

From: Csányi Pál <csanyipal(at)gmail(dot)com>
To: general pgsql <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: ERROR: stack depth limit exceeded
Date: 2025-02-19 10:23:18
Message-ID: CAONhAovOas_XLigiebcfL5_q9M2iCHwG5hkYQk0L0qh_8RoQEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am running postgresql 15 on Debian 12 operating system.
I also installed PgAdmin4 and am using the desktop version of it.
I have created a trigger function and a trigger which will run the
following code, see below.
Before this trigger would run, I tried this code.
When running the code I get the following error message:
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.

Where am I making a mistake, and what can I do to make this code and
this trigger run successfully?

-- Insert the RSD saved between my last two pensions in the
haavi_megtakaritasaink table.
-- INSERT INTO x(a) VALUES (tsrange($1, $2, '[)'));
-- Includes the first date [, the second date is not ).
INSERT INTO
vagyonunk_kezelese.public.havonkenti_megtakaritasaink
(ezen_idokozben, megtakaritva_rsd, kelt)
VALUES ((select tsrange((
SELECT
kelt
FROM
javaink_forgalma
WHERE
EN_KAPTAM = 'true'
AND AZ_ARU_NEVE = 'nyugdíjam'
ORDER BY
KELT DESC
LIMIT
1
OFFSET
1
),(
SELECT
KELT
FROM
JAVAINK_FORGALMA
WHERE
EN_KAPTAM = 'true'
AND AZ_ARU_NEVE = 'nyugdíjam'
ORDER BY
KELT DESC
LIMIT
1
OFFSET
0
),'[)')),(SELECT
SUM(EGYSEGAR * ENNYI_EGYSEG)
FROM
JAVAINK_FORGALMA
WHERE
A_PENZNEM = 'RSD'
AND KELT >= (
SELECT
KELT
FROM
JAVAINK_FORGALMA
WHERE
EN_KAPTAM = 'true'
AND AZ_ARU_NEVE = 'nyugdíjam'
ORDER BY
KELT DESC
LIMIT
1
OFFSET
1
)
AND KELT < (
SELECT
KELT
FROM
JAVAINK_FORGALMA
WHERE
EN_KAPTAM = 'true'
AND AZ_ARU_NEVE = 'nyugdíjam'
ORDER BY
KELT DESC
LIMIT
1
OFFSET
0
)), DEFAULT)
;

Thanks for all the advice!

--
Best wishes by Paul Chanyi!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ayush Vatsa 2025-02-19 10:23:48 Re: Clarification on Role Access Rights to Table Indexes
Previous Message Laurenz Albe 2025-02-19 09:50:27 Re: PGDG PostgreSQL Debian package: Question on conditions for creation of new cluster