Search Postgresql Archives

Re: ERROR: stack depth limit exceeded

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux