Re: pg_basebackup and error messages dependent on the order of the arguments

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: "Daniel Westermann (DWE)" <daniel(dot)westermann(at)dbi-services(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup and error messages dependent on the order of the arguments
Date: 2024-09-30 16:34:22
Message-ID: 99f5165e-f604-4078-8823-c758dbed5e0e@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024/09/30 20:10, Daniel Westermann (DWE) wrote:
> Hi,
>
> shouldn't this give the same error message?
>
> $ pg_basebackup --checkpoint=fast --format=t --compress --pgdata=/var/tmp/dummy
> pg_basebackup: error: must specify output directory or backup target
> pg_basebackup: hint: Try "pg_basebackup --help" for more information.
>
> $ pg_basebackup --pgdata=/var/tmp/dummy --checkpoint=fast --format=t --compress
> pg_basebackup: option '--compress' requires an argument
> pg_basebackup: hint: Try "pg_basebackup --help" for more information.
>
> I don't see why the first case gives not the same message as the second, especially as the "output directory" is specified.

I guess because "--pgdata=/var/tmp/dummy" is processed as the argument of
--compress option in the first case, but not in the second case.
You can see the same error if you specify other optoin requiring an argument,
such as --label, in the first case.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-09-30 16:39:40 Re: pg_basebackup and error messages dependent on the order of the arguments
Previous Message Amit Kapila 2024-09-30 16:20:00 Re: BUG #18641: Logical decoding of two-phase commit fails with TOASTed default values