From: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
---|---|
To: | gzh <gzhcoder(at)126(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: ERROR: stack depth limit exceeded |
Date: | 2023-09-08 06:40:32 |
Message-ID: | f178e33bd19c6a5a63212f2c8554005b80b872d0.camel@cybertec.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, 2023-09-08 at 11:32 +0800, gzh wrote:
> 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?
Asking us to exhaustively describe all queries that could cause errors now
so that you can compare your queries with them is not a good way forward.
Please note that the release notes speak of "contrived queries", so you can
imagine things like
SELECT (
SELECT (
SELECT (
[1000 more such repetitions]
SELECT 1
[lots of closing parentheses]
Anyway, the queries that the fix makes throw errors in 12.14 are queries that
would also give you trouble in 12.13, and worse trouble than an error
("unreasonable amounts of time spent").
My advice it not to worry.
But if you feel like worrying very much, go ahead and test your application
thoroughly with 12.14.
Yours,
Laurenz Albe
From | Date | Subject | |
---|---|---|---|
Next Message | Torsten Krah | 2023-09-08 07:22:29 | Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index" |
Previous Message | Les | 2023-09-08 06:29:34 | pg_restore unexpected end of file |