public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ashutosh Bapat <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: SATYANARAYANA NARLAPURAM <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Bug: Missing check_stack_depth() in GRAPH_TABLE rewriter
Date: Fri, 24 Apr 2026 14:59:45 +0530
Message-ID: <CAExHW5tywW_yYxXnrpwpCmG-K4QQbyVjqXyNuuwydTcV9VHE8A@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAHg+QDfgK0xddH8f3eAb+UVn7sBDOnv8RvM6OkP4HtHAt6aD7w@mail.gmail.com>
	<CAExHW5sEQOK3F+pkZcFy=FX-dOhdittBS6A7Hf88HT841bunLg@mail.gmail.com>
	<[email protected]>

On Fri, Apr 24, 2026 at 11:54 AM Peter Eisentraut <[email protected]> wrote:
>
> On 15.04.26 17:07, Ashutosh Bapat wrote:
> > Thanks for the report. I could reproduce the segfault on my laptop.
> > The attached patch fixes it and gives ERROR:  stack depth limit
> > exceeded.
> >
> > generate_queries_for_path_pattern_recurse() - has to work in a linear
> > fashion since the elements need to be processed in an order. Each
> > permutation of elements produces one query. These queries can be
> > arranged in a balanced tree as you  suggest OR when constructing the
> > setop tree we could generate it in divide-and-conquer manner. However,
> > the tree will be flattened in the planner anyway (See
> > flatten_simple_union_all() and pull_up_simple_union_all()). Thus the
> > final planning will require a deeper stack anyway. The code complexity
> > doesn't seem to be worth it.
> >
> > I also looked at a few commits that add check_stack_depth() to see if
> > we add tests for these scenarios. But I didn't find any. So no tests
> > added with this commit.
>
> committed
>

Thanks a lot for committing this and other fixes.

> (I moved the #include "miscadmin.h" to a more alphabetical position.)
>

Didn't notice this. Sorry.

-- 
Best Wishes,
Ashutosh Bapat





view thread (4+ 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], [email protected]
  Subject: Re: Bug: Missing check_stack_depth() in GRAPH_TABLE rewriter
  In-Reply-To: <CAExHW5tywW_yYxXnrpwpCmG-K4QQbyVjqXyNuuwydTcV9VHE8A@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