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!