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

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

> https://www.postgresql.org/docs/current/static/app-psql.html

> 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.

This is, unfortunately, platform-specific.  glibc's version of
getopt_long() takes it upon itself to physically rearrange the argv
list to make such cases work.  On platforms where getopt_long() does
not so blatantly exceed its authority, only the documented argument
order will work.

            regards, tom lane


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: [GENERAL] psql: do/should we document that argument and option specificationorder doesn't matter?
Следующее
От: George Neuner
Дата:
Сообщение: Re: [GENERAL] Top posting....