use check_mut_excl_opts() in more places

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: use check_mut_excl_opts() in more places
Date: 2026-12-02 22:59:45
Message-ID: axCi4fN5neOBiPHA@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Now that pg_dump, pg_dumpall, and pg_restore all use check_mut_excl_opts()
for conflicting options (see commits c32af0353b and 74f5aba377), I went
looking for other frontend programs that could use it. The attached patch
converts the hand-rolled checks I found in nine of them. It doesn't fix
any bugs, but it trims about 85 lines of code and makes the error messages
for these conflicting options match the one used by pg_dump and friends.

Note that several of these programs currently print a "Try --help" hint
after reporting conflicting options, and check_mut_excl_opts() does not, so
the hint will no longer be printed in those cases. As I said elsewhere
[0], IMHO the hint is kind of silly for these errors because --help doesn't
provide any useful information about which options conflict with each
other.

Thoughts?

[0] https://postgr.es/m/aacYSfgxTb6neYiu%40nathan

--
nathan

Attachment Content-Type Size
v1-0001-Make-use-of-check_mut_excl_opts-in-more-places.patch text/plain 22.0 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-12-02 23:01:55 Re: executor startup doesn't skip sub-partitions of a pruned partition
Previous Message Henson Choi 2026-12-02 22:01:37 Re: Speed up tuplestore_seek() by starting from the nearest known position