Re: [PATCH] vacuumdb: Add --exclude-database option

Mohamed ALi <moali.pg@gmail.com>

From: Mohamed ALi <moali.pg@gmail.com>
To: wenhui qiu <qiuwenhuifx@gmail.com>
Cc: Quan Zongliang <quanzongliang@yeah.net>, pgsql-hackers@lists.postgresql.org
Date: 2026-06-10T06:24:53Z
Lists: pgsql-hackers

Attachments

Hi Quan, wenhui,

Thanks for the review and feedback.

On Thu, Jun 5, 2026 at 09:25:52 AM, Quan Zongliang wrote:
> In the vacuum_all_databases function. If the condition 'if
> (dbsToExclude)' is used. All 'exclude-database' processing (including
> variable definitions) can be placed in a separate code block.

Good suggestion. Attached is v2 incorporating this change, the
exclude-database logic (including the `cell` and `first` variable
declarations) is now scoped inside an `if (dbsToExclude)` block.
This keeps the variables out of the function's top-level scope when
the feature isn't being used.


The patch is also tracked in CommitFest PG20-1:
https://commitfest.postgresql.org/patch/6833/

-- 
Mohamed Ali
AWS RDS