On Tue, Jul 14, 2026 at 5:31 PM Mahendra Singh Thalor
<[email protected]> wrote:
> Attached are two small, independent patches that redo that conversion on
> top of current master:

Thanks for the patches!


>   0001 - pg_restore.c: converts its *-only / --no-* / --statistics /
>          --clean / --single-transaction conflict checks to
>          check_mut_excl_opts().

Commit 7c8280eeb58 converted the checks for -d/--dbname vs. -f/--file and
-d/--dbname vs. --restrict-key to use check_mut_excl_opts(). But this patch
doesn't seem to restore those conversions. Is that intentional?


>   0002 - pg_dumpall.c: same conversion for --exclude-database, the *-only
>          options, their --no-* counterparts, --statistics, and --clean.
>          Also tracks -s/--schema-only locally (schema_only), which
>          pg_dumpall previously just passed through to pg_dump without
>          recording, since check_mut_excl_opts() needs it. Updates the
>          expected error text in the TAP tests to match
>          check_mut_excl_opts()'s "options X and Y cannot be used together"
>          wording, and adds coverage for a couple of option pairs that
>          previously had no dedicated test.

+ /* --exclude-database is incompatible with global *-only options */
+ check_mut_excl_opts(database_exclude_patterns.head, "--exclude-database",
+ globals_only, "-g/--globals-only",

database_exclude_patterns.head is a pointer, but check_mut_excl_opts_internal()
reads the corresponding varargs value as an int. Passing a pointer and reading
it as an int doesn't seem correct. How about passing a boolean instead, e.g.:

    check_mut_excl_opts(database_exclude_patterns.head != NULL,

There seems to be a similar existing call in pg_dump.c using
foreign_servers_include_patterns.head, so it would be good to fix
that as well.

Regards,

-- 
Fujii Masao


Reply via email to