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

From Chao Li
Subject tablecmds: clarify recurse vs recusing
Date
Msg-id CAEoWx2n9E6_zxPbqwMpaPuC1C_p4b3y635SjiDuCPSVm8GBjsA@mail.gmail.com
Whole thread Raw
Responses Re: tablecmds: clarify recurse vs recusing
List pgsql-hackers
Hi Hacker,

Many ALTER TABLE-related functions take two boolean parameters, "recurse" and "recursing", whose names are easy to confuse. For example:
```
/*
* ALTER TABLE ALTER COLUMN DROP IDENTITY
*
* Return the address of the affected column.
*/
static ObjectAddress
ATExecDropIdentity(Relation rel, const char *colName, bool missing_ok, LOCKMODE lockmode,
                   bool recurse, bool recursing)
```

The "recurse" parameter actually indicates whether ONLY was *not* specified in the ALTER TABLE command. It’s supposed to affect both inherited tables and partitioned tables.

In contrast, "recursing" is an internal indicator that only affects inherited tables.

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

In this patch set:

* 0001 - only renames “recurse” to “no_only” together with minimum comment updates.
* 0002 - performs a small mechanical refactoring, replacing “if (no_only) cmd->no_only = true” to “cmd->no_only = no_only”.

Related patches are [1], [2] and [3]:


Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Simplify code building the LR conflict messages
Next
From: Soumya S Murali
Date:
Subject: Re: 001_password.pl fails with --without-readline