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

From gzh
Subject Re: ERROR: stack depth limit exceeded
Date
Msg-id 1211c4ba.2822.18a72d975fc.Coremail.gzhcoder@126.com
Whole thread Raw
In response to Re: ERROR: stack depth limit exceeded  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ERROR: stack depth limit exceeded  (Laurenz Albe <laurenz.albe@cybertec.at>)
Re: ERROR: stack depth limit exceeded  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general

I'm sorry I didn't explain the issue clearly. 

Our system is currently running on PostgreSQL 12.13 and we are planning to upgrade to PostgreSQL 12.16. 

We are currently in the evaluation phase. 

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. 

If our understanding of this change is correct, we would like to find out 

which SQL statements will report errors in the new version. 

Do you have any good methods for doing this?





At 2023-09-07 21:29:56, "Tom Lane" <tgl@sss.pgh.pa.us> wrote: >gzh <gzhcoder@126.com> writes: >> I upgraded the version of PostgreSQL from 12.13 to 12.16. >> If multiple subqueries or a large number of UNION ALL were used, >> the previously unseen error message "ERROR: stack depth limit exceeded" will appear after upgrading the version. > >Please provide a self-contained example. The people who might be >able to fix this are too busy to guess about what you are seeing. > > regards, tom lane

pgsql-general by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Query performance going from Oracle to Postgres
Next
From: Sai Teja
Date:
Subject: Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL