Proposal for Grand Unified Configuration scheme

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Proposal for Grand Unified Configuration scheme
Date: 2000-03-06 15:59:57
Message-ID: Pine.LNX.4.21.0003061512190.362-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I have (almost) nothing to do for about 3 weeks, so I thought I'd get
started on some stuff for next time around.

The idea here is to unify all the various configuration settings into one
coherent scheme. This would include:

* pg_options
* pg_geqo
* postmaster.opts
* Most of the postgres and postmaster command line options
* (almost?) everything you can use SET on
* All the temporary solutions via server side environment variables

The idea would be an obvious (IMO) extension of what's done in
commands/variable.c: Every conceivable option is assigned a name similar
to an SQL identifier. With that name you could (under this proposal):

1) Do SET "foo" TO 'bar' as usual

2) Pass a default value to the backend via some generic option, say
-@ foo=bar

3) Do the same via the PGOPTIONS variant from the client side

4) Provide a global default via an entry in a configuration file, say
pg_config, of the form foo=bar.

Of course the current and in general the popular options will also retain
their one letter switch in the backend.

In addition it would be nice to include some (better all) of the static
postmaster options (of the -p and -N variety) in the scheme. In that case
only (4) above will apply, of course.

What does this all accomplish you ask? Well, first of all it provides a
framework for making configuration options available via a variety of
channels in a consistent fashion. Secondly, it provides a framework for
easily adding options in the first place. No more, "should this be a
configure option?" (because it most likely should not be a configure
option :). Finally, it gives people something to do when they should be
"administering" their database server. ;)

Let me know what you think. Don't be rushed if you have other things to do
right now.

A somewhat related but more difficult and controversial project would be
to unify the options between postmaster and postgres and revise some of
the old mechanisms from the time when they were separate executables. For
example it would be nice if I could start the postmaster with the -F
option and it would look that up in the grand unified options table (see
above) and say "ah, that's a per-backend option" and pass it on to the
backend. In the above framework this wouldn't be too difficult to do, but
there are conflicting option letters between the two. Of course what
*really* ought to happen is to give up that postgres/postmaster naming
dichotomy as such, but that's another day ...

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Proposal for Grand Unified Configuration scheme
Date: 2000-03-07 03:31:56
Message-ID: 200003070331.WAA03864@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:

> I have (almost) nothing to do for about 3 weeks, so I thought I'd get
> started on some stuff for next time around.

Lucky you

> The idea here is to unify all the various configuration settings into one
> coherent scheme. This would include:
>
> [...]
>
> Let me know what you think. Don't be rushed if you have other things to do
> right now.

Sounds good to me.

Jan from Philly

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Proposal for Grand Unified Configuration scheme
Date: 2000-03-07 08:15:31
Message-ID: 19385.952416931@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> The idea here is to unify all the various configuration settings into one
> coherent scheme.

A good goal. Your sketch seems reasonable, but one comment:

> ... For
> example it would be nice if I could start the postmaster with the -F
> option and it would look that up in the grand unified options table (see
> above) and say "ah, that's a per-backend option" and pass it on to the
> backend.

In fact -F is *not* a per-backend option, and certainly we dare not
change it on-the-fly via SET. The setting is useless and even dangerous
unless all backends are behaving the same way (see pghackers archives if
you've forgotten why). More generally, some options are reasonable to
set at any time and some aren't; your mechanism needs to deal with that.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Proposal for Grand Unified Configuration scheme
Date: 2000-03-08 00:00:16
Message-ID: 200003080000.TAA03639@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

[Charset ISO-8859-1 unsupported, filtering to ASCII...]
> I have (almost) nothing to do for about 3 weeks, so I thought I'd get
> started on some stuff for next time around.
>
> The idea here is to unify all the various configuration settings into one
> coherent scheme. This would include:
>
> * pg_options
> * pg_geqo
> * postmaster.opts
> * Most of the postgres and postmaster command line options
> * (almost?) everything you can use SET on
> * All the temporary solutions via server side environment variables

Clearly has to be done.

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026