[GENERAL] psql: do/should we document that argument and option specificationorder doesn't matter?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема [GENERAL] psql: do/should we document that argument and option specificationorder doesn't matter?
Дата
Msg-id CAKFQuwYWdFnwa3eHRnrvGrbQszv=RuDOZ+B-atMsLgad9-egjw@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] psql: do/should we document that argument and option specification order doesn't matter?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I don't know if this applies anywhere else but I just stumbled across the fact that our psql documentation is imprecise:


psql [option...] [dbname [username]]

It does matter that "dbname" precede username; and that it be present if username is specified.  But otherwise the first one or two non-option words on the command line are taken to be those regardless of position, and any extra non-option words are ignored.  Options can thus be specified before, after, or in between the dbname and username.

i.e., the following is valid:

psql [dbname] [option...] [# you can place username here but only if dbname is specified...]

Ubuntu Bash; 9.5 tested.

I'm not sure how one would actually document the above in a syntax specification without being overly verbose but there is no hint that I've found pertaining to the true behavior.  Haven't played with any other of the supplied binaries; I stumbled across this because I was wrapping psql in specialized functions and was surprised that where I placed the "$@" and/or the "service=service-name" specification didn't seem to matter.

Is this some general Bash/Linux-ism that I've just never read about or realized until now?

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL]
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] psql: do/should we document that argument and option specification order doesn't matter?