Re: tablecmds: clarify recurse vs recusing - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: tablecmds: clarify recurse vs recusing
Date
Msg-id CAExHW5s6WfMtJCTDSa6CtLnKpxNyYZV0tRko=M2PfmauNJs_vg@mail.gmail.com
Whole thread Raw
In response to Re: tablecmds: clarify recurse vs recusing  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: tablecmds: clarify recurse vs recusing
List pgsql-hackers
On Mon, Jan 19, 2026 at 9:20 PM Peter Eisentraut <peter@eisentraut.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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: tablecmds: clarify recurse vs recusing
Next
From: jian he
Date:
Subject: Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint