Re: Set arbitrary GUC options during initdb

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2023-03-22T17:04:35Z
Lists: pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> This patch looks good to me.  It's a very nice simplification of the 
> initdb.c code, even without the new feature.

Thanks for looking!

> I found that the addition of
> #include <ctype.h>
> didn't appear to be necessary.  Maybe it was required before 
> guc_value_requires_quotes() was changed?

There's still an isspace() added by the patch ... oh, the #include
is not needed because port.h includes ctype.h.  That's spectacularly
awful from an include-footprint standpoint, but I can't say that
I want to go fix it right this minute.

> I would remove the
> #if DEF_PGPORT != 5432
> This was in the previous code too, but now if we remove it, then we 
> don't have any more hardcoded 5432 left, which seems like a nice 
> improvement in cleanliness.

Hm.  That'll waste a few cycles during initdb; not sure if the extra
cleanliness is worth it.  It's not like that number is going to change.

			regards, tom lane



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.