Re: make pg_controldata accept "-D dirname"

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: make pg_controldata accept "-D dirname"
Дата
Msg-id 20140924135849.GO5311@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: make pg_controldata accept "-D dirname"  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Ответы Re: make pg_controldata accept "-D dirname"  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Список pgsql-hackers
Abhijit Menon-Sen wrote:

> P.S. Trivia: I can't find any other options in Postgres where the
> argument is mandatory but the option is optional.

psql behaves similarly with its -d and -U switches also; note --help:

Usage: psql [OPTION]... [DBNAME [USERNAME]]
... -d, --dbname=DBNAME      database name to connect to (default: "alvherre")
... -U, --username=USERNAME  database user name (default: "alvherre")


Both are optional and have defaults.  Datadir for pg_controldata is also
optional and --help contains this blurb:

If no data directory (DATADIR) is specified, the environment variable PGDATA
is used.

I think you could replace those lines with -D        data directory blah (default: "value of $PGDATA")


But psql --help doesn't use $PGUSER to expand the default value for -U;
I'm not clear if this means we shouldn't expand PGDATA in the help line
for pg_controldata, or need to fix psql to expand PGUSER in -U.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Oskari Saarenmaa
Дата:
Сообщение: Re: missing isinf declaration on solaris
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: "Core" function in Postgres