| From: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
|---|---|
| To: | Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | tablecmds: clarify recurse vs recusing |
| Date: | 2026-01-19 07:14:48 |
| Message-ID: | CAEoWx2n9E6_zxPbqwMpaPuC1C_p4b3y635SjiDuCPSVm8GBjsA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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]:
[1]
https://postgr.es/m/CAEoWx2nJ71hy8R614HQr7vQhkBReO9AANPODPg0aSQs74eOdLQ@mail.gmail.com
[2]
https://postgr.es/m/CAEoWx2=mYhCfsnHaN96Qqwq5b0GVS2YgO3zpVqPPRd_iO52wRw@mail.gmail.com
[3]
https://postgr.es/m/CAEoWx2=SLga-xH09Cq_PAvsHhQHrBK+V0vF821JKgzS=Bm0haA@mail.gmail.com
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0002-tablecmds-simplify-propagation-of-no_only-flag.patch | application/octet-stream | 5.0 KB |
| v1-0001-tablecmds-rename-recurse-to-no_only.patch | application/octet-stream | 59.8 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Soumya S Murali | 2026-01-19 07:32:56 | Re: 001_password.pl fails with --without-readline |
| Previous Message | Amit Kapila | 2026-01-19 07:04:14 | Re: Simplify code building the LR conflict messages |