Re: createdb feature request

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: createdb feature request
Дата
Msg-id 24074.1076541830@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: createdb feature request  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Richard Huxton <dev@archonet.com> writes:
> Postfix has a useful utility called "postconf"
>   postconf => display all settings
>   postconf foo => display setting foo
>   postconf -n => display non-standard config settings
> Other stuff too, see http://www.postfix.org/postconf.1.html

> Standard procedure for problems on the postfix list is to ask for "postconf
> -n" output before anything else.

Hmm.  The SQL-ish way to do this would be

    select name, setting, source from pg_settings
    where setting != default_value;

The compiled-in default value for each GUC variable is available in the
GUC data structure, but pg_settings doesn't currently expose it.
Possibly we should add that.

You can almost do it today with

    select name, setting, source from pg_settings
    where source != 'default';

but this clutters the output a little with values that have been
explicitly set but are still equal to the default.  For instance,
I get

regression=# select name, setting, source from pg_settings
regression-# where source != 'default';
         name          |    setting     |        source
-----------------------+----------------+----------------------
 fsync                 | off            | command line
 lc_collate            | C              | override
 lc_ctype              | C              | override
 lc_messages           | C              | database
 lc_monetary           | C              | database
 lc_numeric            | C              | database
 lc_time               | C              | database
 max_connections       | 100            | configuration file
 server_encoding       | SQL_ASCII      | override
 shared_buffers        | 1000           | configuration file
 tcpip_socket          | on             | command line
 TimeZone              | EST5EDT        | environment variable
 transaction_isolation | read committed | override
 transaction_read_only | off            | override
(14 rows)

Not sure if it's worth any work to shorten that.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Prepared queries
Следующее
От: Tom Lane
Дата:
Сообщение: Re: No More Processes