postgresql/src/backend/utils
Tom Lane 195e81aff5 Find postgresql.auto.conf in PGDATA even when postgresql.conf is elsewhere.
The original coding for ALTER SYSTEM made a fundamentally bogus assumption
that postgresql.auto.conf could be sought relative to the main config file
if we hadn't yet determined the value of data_directory.  This fails for
common arrangements with the config file elsewhere, as reported by
Christoph Berg.

The simplest fix is to not try to read postgresql.auto.conf until after
SelectConfigFiles has chosen (and locked down) the data_directory setting.

Because of the logic in ProcessConfigFile for handling resetting of GUCs
that've been removed from the config file, we cannot easily read the main
and auto config files separately; so this patch adopts a brute force
approach of reading the main config file twice during postmaster startup.
That's a tad ugly, but the actual time cost is likely to be negligible,
and there's no time for a more invasive redesign before beta.

With this patch, any attempt to set data_directory via ALTER SYSTEM
will be silently ignored.  It would probably be better to throw an
error, but that can be dealt with later.  This bug, however, would
prevent any testing of ALTER SYSTEM by a significant fraction of the
userbase, so it seems important to get it fixed before beta.
2014-05-11 15:13:30 -04:00
..
adt Rename jsonb_hash_ops to jsonb_path_ops. 2014-05-11 12:06:04 -04:00
cache pgindent run for 9.4 2014-05-06 12:12:18 -04:00
error pgindent run for 9.4 2014-05-06 12:12:18 -04:00
fmgr pgindent run for 9.4 2014-05-06 12:12:18 -04:00
hash pgindent run for 9.4 2014-05-06 12:12:18 -04:00
init pgindent run for 9.4 2014-05-06 12:12:18 -04:00
mb pgindent run for 9.4 2014-05-06 12:12:18 -04:00
misc Find postgresql.auto.conf in PGDATA even when postgresql.conf is elsewhere. 2014-05-11 15:13:30 -04:00
mmgr pgindent run for 9.4 2014-05-06 12:12:18 -04:00
resowner pgindent run for 9.4 2014-05-06 12:12:18 -04:00
sort pgindent run for 9.4 2014-05-06 12:12:18 -04:00
time pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Update copyright for 2014 2014-01-07 16:05:30 -05:00
Gen_dummy_probes.sed Update copyright for 2014 2014-01-07 16:05:30 -05:00
Gen_fmgrtab.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
generate-errcodes.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
Makefile Make handling of errcodes.h more consistent with other generated headers. 2011-02-04 09:29:10 -05:00
probes.d Fix build with LWLOCK_STATS or dtrace. 2014-03-21 23:26:34 +01:00