tablecmds: clarify recurse vs recusing

Поиск
Список
Период
Сортировка
От Chao Li
Тема tablecmds: clarify recurse vs recusing
Дата
Msg-id CAEoWx2n9E6_zxPbqwMpaPuC1C_p4b3y635SjiDuCPSVm8GBjsA@mail.gmail.com
обсуждение исходный текст
Ответы Re: tablecmds: clarify recurse vs recusing
Список 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/




Вложения

В списке pgsql-hackers по дате отправления: