Re: ERROR: stack depth limit exceeded - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: ERROR: stack depth limit exceeded
Date
Msg-id CAKAnmmLoiQGtnL4is9LUEynM7MAO6_KkMYSjME_nTNuThR-Ehw@mail.gmail.com
Whole thread Raw
In response to ERROR: stack depth limit exceeded  (Csányi Pál <csanyipal@gmail.com>)
List pgsql-general
Not related to the main question, but that query could use a little adjustment. Something like:

WITH x AS (
  select kelt from javaink_forgalma
  where en_kaptam is true and az_aru_neve = 'nyugdíjam'
  order by kelt desc limit 2
)
,y AS (select min(kelt) from x)
,z AS (select max(kelt) from x)
INSERT INTO public.havonkenti_megtakaritasaink (ezen_idokozben, megtakaritva_rsd, kelt)
VALUES (
  (select tsrange(min,max,'[)') FROM y,z)
, (select sum(egysegar * ennyi_egyseg) from javaink_forgalma, y, z
   where a_penzem = 'RSD' and kelt >= min and kelt < max)
, DEFAULT
);

Also, it's best to use "timestamp with time zone" NOT "timestamp without time zone" whenever possible (i.e. timestamptz not timestamp)

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support

pgsql-general by date:

Previous
From: Schmid Andreas
Date:
Subject: AW: PGDG PostgreSQL Debian package: Question on conditions for creation of new cluster
Next
From: Laurenz Albe
Date:
Subject: Re: AW: PGDG PostgreSQL Debian package: Question on conditions for creation of new cluster