Magnus, All,

This is something I've been thinking about too, just because my efforts to 
write auto-config scripts have gotten bogged down in the need to parse and 
write .conf files in a paltform-agnostic way and preserve comments.  I 
agree with Magnus that it's something we need to address.  Having the 
ability to update .conf through an api other than reading & writing a file 
one line will make developing future autotuning tools significanly easier.

I think that the idea of just appending extra lines to the bottom of the 
file 
in chronoligical (or random) order is so messy and hackish that it's simply 
not worthy of consideration for the PostgreSQL project.

Instead, here's my proposal:

1) add to the top of postgresql.conf another file switch, like this:

        # auto_config_file = 'ConfigDir/postgresql.auto.conf'
        # if set, the auto config file will be read by the system and override 
the 
settings in the rest of this postgresql.conf file, which will be ignored.
        # to disable automated and SQL command-line-based configuration
        # comment the above or set it to an empty string

2) split the "category" column in pg_settings into two columns, and add a 
categories lookup table, so it can be sorted properly  

3) have command line config write to postgresql.auto.conf, dumping the 
whole of pg_settings organized with headings in categories order.

I think an arrangement like that will work well with pg_settings based 
config, autotuning, while still allowing backwards-compatible manual 
control via postgresql.conf.

-- 
--Josh

Josh Berkus
PostgreSQL @ Sun
San Francisco

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to