Better error message when --single is not the first arg to postgres executable - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Better error message when --single is not the first arg to postgres executable
Date
Msg-id CAKAnmmJkZtZAiSryho=gYpbvC7H-HNjEDAh16F3SoC9LPu8rqQ@mail.gmail.com
Whole thread Raw
Responses Re: Better error message when --single is not the first arg to postgres executable
List pgsql-hackers
Please find attached a quick patch to prevent this particularly bad error message for running "postgres", when making the common mistake of forgetting to put the "--single" option first because you added an earlier arg (esp. datadir)

Current behavior:

$ ~/pg/bin/postgres -D ~/pg/data --single
2024-06-05 18:30:40.296 GMT [22934] FATAL:  --single requires a value

Improved behavior:

$ ~/pg/bin/postgres -D ~/pg/data --single
--single must be first argument.

I applied it for all the "first arg only" flags (boot, check, describe-config, and fork), as they suffer the same fate.

Cheers,
Greg

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: question regarding policy for patches to out-of-support branches
Next
From: Andrew Dunstan
Date:
Subject: Re: ssl tests fail due to TCP port conflict