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

From: Japin Li <japinli(at)hotmail(dot)com>
To: Mohamed ALi <moali(dot)pg(at)gmail(dot)com>
Cc: wenhui qiu <qiuwenhuifx(at)gmail(dot)com>, Quan Zongliang <quanzongliang(at)yeah(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] vacuumdb: Add --exclude-database option
Date: 2026-06-10 09:39:16
Message-ID: SY7PR01MB109213166E7BDA52A33E36A47B61A2@SY7PR01MB10921.ausprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi, Mohamed

On Tue, 09 Jun 2026 at 23:24, Mohamed ALi <moali(dot)pg(at)gmail(dot)com> wrote:
> 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/

Thanks for updating the patch. I have one question.

+$node->command_fails_like(
+ [ 'vacuumdb', '-d' => 'postgres', '--exclude-database' => 'regression_excl_test' ],
+ qr/cannot use --exclude-database without --all option/,
+ 'cannot use --exclude-database with -d');

The test is a bit confusing to me. It does not state that --exclude-database
cannot be used with the -d option.

>
> --
> Mohamed Ali
> AWS RDS

--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Wolfgang Walther 2026-06-10 09:43:07 Re: PRI?64 vs Visual Studio (2022)
Previous Message shveta malik 2026-06-10 09:37:27 Re: Proposal: Conflict log history table for Logical Replication