I took a look at v29-0006.
On Tue, Sep 17, 2024 at 05:02:49AM -0400, Corey Huinker wrote:
> From: Corey Huinker <corey.huinker@gmail.com>
> Date: Sat, 4 May 2024 04:52:38 -0400
> Subject: [PATCH v29 6/7] Add derivative flags dumpSchema, dumpData.
>
> User-set flags --schema-only and --data-only are often consulted by
> various operations to determine if they should be skipped or not. While
> this logic works when there are only two mutually-exclusive -only
> options, it will get progressively more confusing when more are added.
After glancing at v29-0007, I see what you mean.
> In anticipation of this, create the flags dumpSchema and dumpData which
> are derivative of the existing options schemaOnly and dataOnly. This
> allows us to restate current skip-this-section tests in terms of what is
> enabled, rather than checking if the other -only mode is turned off.
This seems like a reasonable refactoring exercise that we could take care
of before the rest of the patch set goes in. I added one new reference to
dopt.schemaOnly in commit bd15b7d, so that should probably be revised to
!dumpData, too. I also noticed a few references to dataOnly/schemaOnly in
comments that should likely be adjusted.
One other question I had when looking at this patch is whether we could
remove dataOnly/schemaOnly from DumpOptions and RestoreOptions. Once 0007
is applied, those variables become particularly hazardous, so we really
want to prevent folks from using them in new code.
--
nathan