public inbox for [email protected]  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <[email protected]>
To: [email protected]
Cc: general pgsql <[email protected]>
Subject: Re: ERROR: stack depth limit exceeded
Date: Wed, 19 Feb 2025 09:31:33 -0500
Message-ID: <CAKAnmmLoiQGtnL4is9LUEynM7MAO6_KkMYSjME_nTNuThR-Ehw@mail.gmail.com> (raw)
In-Reply-To: <CAONhAovOas_XLigiebcfL5_q9M2iCHwG5hkYQk0L0qh_8RoQEw@mail.gmail.com>
References: <CAONhAovOas_XLigiebcfL5_q9M2iCHwG5hkYQk0L0qh_8RoQEw@mail.gmail.com>

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


view thread (2+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: ERROR: stack depth limit exceeded
  In-Reply-To: <CAKAnmmLoiQGtnL4is9LUEynM7MAO6_KkMYSjME_nTNuThR-Ehw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox