Re: Recursive query - ERROR: invalid memory alloc request size 1073741824

From: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Recursive query - ERROR: invalid memory alloc request size 1073741824
Date: 2022-05-08 19:15:54
Message-ID: CANbhV-EXLBNR00HGOcxTi2Qoc-9aYmg5SG9a3C8hPqGYGJ0X5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sat, 7 May 2022 at 14:24, Shaozhong SHI <shishaozhong(at)gmail(dot)com> wrote:
>
> There is a loop of recursive query. It runs at a point where it stops.
>
> This error turned up.- ERROR: invalid memory alloc request size 1073741824
>
> Can anyone provide pointers how to solve this problem or work around?

For both recursive and non-recursive queries its possible to write a
query with mistakes in it that will run for a long time or run out of
resources.

Find the mistakes in your query by simplifying it.

--
Simon Riggs http://www.EnterpriseDB.com/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Shaozhong SHI 2022-05-10 00:58:26 Set timeout just on a query?
Previous Message Tom Lane 2022-05-07 15:19:37 Re: Recursive query - ERROR: invalid memory alloc request size 1073741824