Re: postgresql.auto.conf read from wrong directory - Mailing list pgsql-hackers

From Tom Lane
Subject Re: postgresql.auto.conf read from wrong directory
Date
Msg-id 6853.1399836024@sss.pgh.pa.us
Whole thread Raw
In response to Re: postgresql.auto.conf read from wrong directory  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: postgresql.auto.conf read from wrong directory  (Robert Haas <robertmhaas@gmail.com>)
Re: postgresql.auto.conf read from wrong directory  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
I wrote:
> I think what probably has to happen is that ProcessConfigFile shouldn't
> be internally responsible for reading the auto file at all, but that we
> do that via two separate calls to ProcessConfigFile, one for the main
> file and then one for the auto file; and during initial startup,
> SelectConfigFiles doesn't make the call for the auto file until after
> it's established the final value of data_directory.

Since this bug would block testing of ALTER SYSTEM by a nontrivial
population of users, I felt it was important to get it fixed before beta,
so I went to try and fix it as above.  It turns out that reading the two
config files separately doesn't work because ProcessConfigFile will think
all the settings got removed from the file.  What we can do for the
moment, though, is to just run ProcessConfigFile twice during startup,
skipping the auto file the first time.  It might be worth refactoring
ProcessConfigFile to avoid the overhead of reading postgresql.conf twice,
but it would be a lot of work and I think the gain would be marginal; in
any case there's not time to do that today.  But I've got the main problem
fixed in time for beta.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgresql.auto.conf read from wrong directory
Next
From: Magnus Hagander
Date:
Subject: Re: imprecise pg_basebackup documentation about excluded files