Re: Better error message when --single is not the first arg to postgres executable
От | Greg Sabino Mullane |
---|---|
Тема | Re: Better error message when --single is not the first arg to postgres executable |
Дата | |
Msg-id | CAKAnmmKW6oK7JuiuD1mHEq3MiVWRhVmp+MRz8Oc_smFCg3CpCA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Better error message when --single is not the first arg to postgres executable (Nathan Bossart <nathandbossart@gmail.com>) |
Ответы |
Re: Better error message when --single is not the first arg to postgres executable
|
Список | 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
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 по дате отправления: