Overhauling GUCS - Mailing list pgsql-hackers

From Josh Berkus
Subject Overhauling GUCS
Date
Msg-id 48409D1E.3070208@agliodbs.com
Whole thread Raw
Responses Re: Overhauling GUCS  (Greg Smith <gsmith@gregsmith.com>)
Re: Overhauling GUCS  (Simon Riggs <simon@2ndquadrant.com>)
Re: Overhauling GUCS  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Overhauling GUCS  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Magnus and I had the fortune to share a plane flight when leaving pgCon.  This gave us a chance to discuss my ideas
aroundreforming PostgreSQL 
 
configuration at some length.  Here's what we came up with (Magnus will 
presumably correct the parts I got wrong):

Currently, PostgreSQL,conf and our set of GUC configurations suffer from 
4 large problems:

1. Most people have no idea how to set these.
2. The current postgresql.conf file is a huge mess of 194 options, the 
vast majority of which most users will never touch.
3. GUCS lists are kept in 3 different places (guc.c, postgresql.conf, 
and the settings.sgml), which are only synched with each other manually.
4. We don't seem to be getting any closer to autotuning.

We think all of these are solvable for 8.4.   We also think that it's 
vitally important than any overhaul of the GUCS to be completed in one 
version to minimize the pain involved.

Here's a list of the things we want to change.  It's all a package and 
should make sense if you take all the changes as a whole.

1) Add several pieces of extra information to guc.c in the form of extra 
"gettext" commands:  default value, subcategory, long description, 
recommendations, enum lists.
2) Incorporate this data into pg_settings
3) Delete postgresql.conf.sample
4) Add a script called pg_generate_conf to generate a postgresql.conf 
based on guc.c and command-line switches (rather than 
postgresql.conf.sample), which would be called automatically by initdb.

For (4), pg_generate_conf would take the following switches:
-b , --basic = short conf file, listing only the 15-18 most commonly 
changed options
-a , --advanced = conf file listing all 196+ options
-t, --terse = conf file lists only category headings and actual 
settings, no comments
-n, --normal = conf file has category and subcategory settings, with 
short desc comments
-v, --verbose = conf file lists full descriptions and recommendations in 
comments with each option
-c "option = value" set specific option to specific value in the file
-f "filename"  = take options and values from file "filename"

The default would be "-b, -n" with specific settings for shared_buffers 
and wal_sync_method.   The current postgresql.conf is a lot more like an 
"-a, -v" file.

This would help us in the following ways:

A. there would now only be 2 places to maintain GUCS lists, the docs and 
guc.c.
B. by having a generated postgresql.conf and an easy way to generate it, 
writing autoconfiguration scripts (as well as shortcuts like SET 
PERSISTENT) become vastly easier.
C. Most users would deal only with a limited set of 15-20 configuration 
variables.

There's obviously some refinements needed, but what do people think of 
the above general idea?


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Core team statement on replication in PostgreSQL
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Core team statement on replication in PostgreSQL