Re: tablecmds: clarify recurse vs recusing

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: tablecmds: clarify recurse vs recusing
Date: 2026-01-19 16:02:54
Message-ID: CAExHW5s6WfMtJCTDSa6CtLnKpxNyYZV0tRko=M2PfmauNJs_vg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 19, 2026 at 9:20 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> On 19.01.26 08:14, Chao Li wrote:
> > Many ALTER TABLE-related functions take two boolean parameters,
> > "recurse" and "recursing", whose names are easy to confuse.
>
> I'm not bothered by this.
>

+1. I had stumbled upon this when working on identity support. I had
the same initial reaction that it's confusing. But soon I got used to
it and any other option wasn't improving the situation. AFAIR, all the
4 possible combinations of those two booleans are possible, but I
can't remember what could recurse = false, recursing = true mean.
recurse = true, recursing = false happens at the start of the
inheritance tree. recurse = false, recursing = false; maybe for a
table which isn't part of inheritance or partition tree. recurse =
true, recursing = true happens when working on a non-leaf non-root
table. If we could find out the impossible combinations and then unify
these two booleans into a single enum variable, that might make code
clearer - at least we will know which combinations are not possible
and which combinations are.

--
Best Wishes,
Ashutosh Bapat

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-01-19 16:11:48 Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint
Previous Message Peter Eisentraut 2026-01-19 15:50:01 Re: tablecmds: clarify recurse vs recusing