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

From Greg Sabino Mullane
Subject Re: Better error message when --single is not the first arg to postgres executable
Date
Msg-id CAKAnmmKW6oK7JuiuD1mHEq3MiVWRhVmp+MRz8Oc_smFCg3CpCA@mail.gmail.com
Whole thread Raw
In response to Re: Better error message when --single is not the first arg to postgres executable  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Better error message when --single is not the first arg to postgres executable
List pgsql-hackers
If I am reading your patch correctly, we have lost the behavior of least surprise in which the first "meta" argument overrides all others:

$ bin/postgres --version --boot --extrastuff
postgres (PostgreSQL) 16.2

What about just inlining --version and --help e.g. 

else if (strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-V") == 0)
{
     fputs(PG_BACKEND_VERSIONSTR, stdout);
     exit(0);
}

I'm fine with being more persnickety about the other options; they are much rarer and not unixy.

However, there's a complication:
...
This remaining discrepancy might be okay, but I was really hoping to reduce
the burden on users to figure out the correct ordering of options.  The
situations in which I've had to use single-user mode are precisely the
situations in which I'd rather not have to spend time learning these kinds
of details.

Yes, that's unfortunate. But I'd be okay with the db-last requirement as long as the error message is sane and points one in the right direction.

Cheers,
Greg

pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Missing docs for new enable_group_by_reordering GUC
Next
From: Tender Wang
Date:
Subject: Re: Should consider materializing the cheapest inner path in consider_parallel_nestloop()