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

2024-10-03 Thread Tom Lane
Robert Haas writes: > On Wed, Oct 2, 2024 at 6:00 AM Daniel Westermann (DWE) > wrote: >> Maybe checking if a valid "-D" or "--pgdata" was given and return a more >> generic error message would be an option? > It doesn't really seem reasonable to me to make the tools guess > whether somebody lef

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

2024-10-03 Thread Robert Haas
On Wed, Oct 2, 2024 at 6:00 AM Daniel Westermann (DWE) wrote: > Maybe checking if a valid "-D" or "--pgdata" was given and return a more > generic error message would be an option? It doesn't really seem reasonable to me to make the tools guess whether somebody left out the argument to an option

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

2024-10-02 Thread Daniel Westermann (DWE)
>> My point was not so much about --compress but rather giving a good error >> message. >Right, and my point was that the issue is bigger than --compress. >For example, you get exactly the same misbehavior with >$ pg_basebackup --checkpoint=fast --format=t -d --pgdata=/var/tmp/dummy >pg_baseback

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

2024-09-30 Thread Tom Lane
"Daniel Westermann (DWE)" writes: >> Taking a closer look, many of the other switches-requiring-an-argument >> also just absorb "optarg" without checking its value till much later, >> so I'm not sure how far we could move the needle by special-casing >> --compress. > My point was not so much abou

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

2024-09-30 Thread Daniel Westermann (DWE)
>I wrote: >> As this example shows, we really ought to validate the compression >> argument on sight in order to get sensible error messages. The >> trouble is that for server-side compression the code wants to just >> pass the string through to the server and not form its own opinion >> as to whe

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

2024-09-30 Thread Tom Lane
I wrote: > As this example shows, we really ought to validate the compression > argument on sight in order to get sensible error messages. The > trouble is that for server-side compression the code wants to just > pass the string through to the server and not form its own opinion > as to whether i

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

2024-09-30 Thread Tom Lane
"Daniel Westermann (DWE)" writes: > 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 in

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

2024-09-30 Thread Fujii Masao
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 --h

pg_basebackup and error messages dependent on the order of the arguments

2024-09-30 Thread Daniel Westermann (DWE)
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