Re: tablecmds: clarify recurse vs recusing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:14:40
Message-ID: 1078495.1768839280@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> 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.

>> To reduce this confusion, I’m proposing to rename "recurse" to
>> "no_only", which more directly reflects its meaning.

> This seems worse. Especially since no_only is almost a double negative.

Yeah, I don't find this change an improvement either. I think the
actual problem here is lack of documentation: unlike many other
places, there is next to zero commentary in tablecmds.c about what
all the function parameters are. It would probably help to define
these, along the lines of

* recurse: true if we should recurse to children of this table
* recursing: true if we are already recursing from some parent table

If we fleshed out the header comment for ATPrepCmd and maybe a few
other key functions along these lines, that would make the logic
a good deal more intelligible, I think.

regards, tom lane

In response to

Browse pgsql-hackers by date

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