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

From: "Daniel Westermann (DWE)" <daniel(dot)westermann(at)dbi-services(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "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-10-02 10:00:39
Message-ID: GV0P278MB0419524178F42D24DEF39C29D2702@GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> 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_basebackup: error: must specify output directory or backup target
>pg_basebackup: hint: Try "pg_basebackup --help" for more information.

>I'm not sure how to solve the problem once you consider this larger
>scope.  I don't think we could forbid arguments beginning with "-" for
>all of these switches.

It is not dependent on short or long switches:
$ pg_basebackup --checkpoint=fast --format=t -p --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 --checkpoint=fast --format=t --port --pgdata=/var/tmp/dummy
pg_basebackup: error: must specify output directory or backup target
pg_basebackup: hint: Try "pg_basebackup --help" for more information.

Maybe checking if a valid "-D" or "--pgdata" was given and return a more generic error message would be an option?

Regards
Daniel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-10-02 11:30:46 Rename PageData to XLogPageData
Previous Message Jim Jones 2024-10-02 09:47:42 Re: Psql meta-command conninfo+