Re: Set arbitrary GUC options during initdb

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2023-01-27T15:29:37Z
Lists: pgsql-hackers
On Wed, Jan 25, 2023 at 4:26 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> So this invents an initdb switch "-c NAME=VALUE" just like the
> one that the server itself has long had.

HUGE +1 from me. This will, I think, be extremely convenient in many situations.

> The specified settings
> are applied on the command line of the initial probe calls
> (which happen before we've made any config files), and then they
> are added to postgresql.auto.conf, which causes them to take
> effect for the bootstrap backend runs as well as subsequent
> postmaster starts.

I agree with others that it would seem more natural to edit them in
postgresql.conf itself, but I also think it doesn't matter nearly as
much as getting the feature in some form.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



Commits

  1. Fix initdb's handling of min_wal_size and max_wal_size.

  2. Reduce memory leakage in initdb.

  3. Add "-c name=value" switch to initdb.