At 2026-12-04 00:07:50, "Heikki Linnakangas" <[email protected]> wrote:
>On 03/12/2026 18:01, Nathan Bossart wrote:
>> pg_upgrade has a separate option for each of its file transfer modes
>> (--clone, --copy, --copy-file-range, --link, and --swap), which I find
>> somewhat silly given only one mode can be used at a time.  The options are
>> scattered around the documentation and the --help output, and every new
>> mode means yet another one (I'm guilty of adding the most recent).  ISTM we
>> ought to combine them.
>> 
>> The attached patch adds --transfer-mode, which accepts the mode as its
>> argument (e.g., --transfer-mode=link).  The documentation for each mode
>> moves to the new option, and the existing options are now listed as
>> deprecated spellings of it.  They continue to work as before, and I doubt
>> we'll ever be able to remove them, but IMHO this is still an improvement.
>
>+1. I didn't read the patch, but I like the idea.
>
>I hope we don't add too many more transfer modes for this to become a 
>huge problem, but IMO --transfer-mode=<mode> just reads nicer.
>
>- Heikki
>

>


Hi Nathan,


I reviewed and tested the patch. The new option maps to the existing 
transfer-mode values and reuses the existing checks and transfer logic. I did
not find any blocking correctness issues.


Just one piece of comment:


The help output loses the indication that copy is the default. Previously, the 
--copy description included “(default)”, but neither its
replacement nor the new --transfer-mode description includes that information. 
Could we add it to the new option’s description? The documentation
already preserves it.


Thanks,
Xueyu Gao

Reply via email to