pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: gzh <gzhcoder@126.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: ERROR: stack depth limit exceeded
Date: Mon, 11 Sep 2023 12:57:39 +0800 (CST)
Message-ID: <4044d693.36c1.18a829a3990.Coremail.gzhcoder@126.com> (raw)
In-Reply-To: <1871319.1694181213@sss.pgh.pa.us>
References: <1e6b9056.492e.18a6e9a1798.Coremail.gzhcoder@126.com>
	<1694898.1694093396@sss.pgh.pa.us>
	<1211c4ba.2822.18a72d975fc.Coremail.gzhcoder@126.com>
	<1871319.1694181213@sss.pgh.pa.us>

Thank you all for taking the time to help me with my question and offer your advice. Your responses were greatly appreciated!

















At 2023-09-08 21:53:33, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>gzh  <gzhcoder@126.com> writes:
>> In the Release Notes for PostgreSQL 12.14, we saw the following change:
>> https://www.postgresql.org/docs/release/12.14/
>
>>> Add recursion and looping defenses in subquery pullup (Tom Lane)
>>> A contrived query can result in deep recursion and unreasonable amounts of time spent trying to flatten subqueries. A proper fix for that seems unduly invasive for a back-patch, but we can at least add stack depth checks and an interrupt check to allow the query to be cancelled.
>
>
>> Our understanding is that this change will cause some complex SQL statements 
>> that were previously not reporting errors to report errors in the new version. 
>
>The key word there is "contrived".  You are not going to hit this limit
>without intentionally trying.  The example that led to adding this check
>was a synthetic query with 10000 UNION ALL branches:
>
>https://www.postgresql.org/message-id/flat/703c09a2-08f3-d2ec-b33d-dbecd62428b8%40postgrespro.ru
>
>Also notice that the query misbehaved before this patch, too, by consuming
>excessive RAM.
>
>			regards, tom lane


view thread (14+ messages)  latest in thread

Message-ID: <4044d693.36c1.18a829a3990.Coremail.gzhcoder@126.com>
Permalink:  ../4044d693.36c1.18a829a3990.Coremail.gzhcoder@126.com/
Also on:    postgresql.org/message-id/4044d693.36c1.18a829a3990.Coremail.gzhcoder@126.com

 · 

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: pgsql-general@postgresql.org
  Cc: gzhcoder@126.com, tgl@sss.pgh.pa.us, pgsql-general@lists.postgresql.org
  Subject: Re: ERROR: stack depth limit exceeded
  In-Reply-To: <4044d693.36c1.18a829a3990.Coremail.gzhcoder@126.com>

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

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