Re: Patch for 9.1: initdb -C option

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: David Christensen <david(at)endpoint(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch for 9.1: initdb -C option
Date: 2010-07-21 00:15:52
Message-ID: 4C463C38.20703@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(2010/07/21 7:33), Kevin Grittner wrote:
> David Christensen<david(at)endpoint(dot)com> wrote:
>> On Jul 20, 2010, at 5:00 PM, Kevin Grittner wrote:
>
>>> my shop has chosen to never touch the default postgresql.conf
>>> file any more, beyond adding one line to the bottom of it which
>>> is an include directive, to bring in our overrides.
>
>> So you'll now issue:
>>
>> $ initdb ... -C 'include localconfig.conf' ? :-)
>
> Yeah, that would cover us. I'm wondering if it is flexible enough
> to serve everyone else so well. I hesitate to suggest it, but
> perhaps it would, in combination with the include directive
> supporting a directory name to mean all files in the directory? Or
> maybe if it supported wildcards?
>
I reminded that David introduced the following example as a usage of
this feature.

$ for cluster in 1 2 3 4 5 6;
do
initdb -D data$cluster -C "port = 1234$cluster" \
-C 'max_connections = 10' \
-C shared_buffers=1M;
done

In this case, it tries to set up six database clusters with constant
max_connections and shared_buffers, but individual port numbers for
each database clusters.

Even if we support include directive here, it may not help to describe
the postgresql.conf with a smart way.

Then, how about the Itagaki-san's suggestion?

Itagaki-san suggested:
| > Enclosed is a patch to add a -C option to initdb to allow you to easily
| > append configuration directives to the generated postgresql.conf file
| Why don't you use just "echo 'options' >> $PGDATA/postgresql.conf" ?
| Could you explain where the -C options is better than initdb + echo?

As long as you don't need any special configuration during the initial
setting up launched by initdb, indeed, it seems to me we can edit the
postgresql.conf later.

Thanks,
--
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-07-21 00:27:21 Re: Patch for 9.1: initdb -C option
Previous Message Robert Haas 2010-07-20 23:52:42 Re: dynamically allocating chunks from shared memory