Re: createdb feature request - Mailing list pgsql-general

From Tom Lane
Subject Re: createdb feature request
Date
Msg-id 24074.1076541830@sss.pgh.pa.us
Whole thread Raw
In response to Re: createdb feature request  (Richard Huxton <dev@archonet.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Prepared queries
Next
From: Tom Lane
Date:
Subject: Re: No More Processes