pgsql: Change first call of ProcessConfigFile so as to process only dat

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change first call of ProcessConfigFile so as to process only dat
Date: 2014-08-12 08:08:42
Message-ID: E1XH78M-0006w8-H8@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Change first call of ProcessConfigFile so as to process only data_directory.

When both postgresql.conf and postgresql.auto.conf have their own entry of
the same parameter, PostgreSQL uses the entry in postgresql.auto.conf because
it appears last in the configuration scan. IOW, the other entries which appear
earlier are ignored. But, previously, ProcessConfigFile() detected the invalid
settings of even those unused entries and emitted the error messages
complaining about them, at postmaster startup. Complaining about the entries
to ignore is basically useless.

This problem happened because ProcessConfigFile() was called twice at
postmaster startup and the first call read only postgresql.conf. That is, the
first call could check the entry which might be ignored eventually by
the second call which read both postgresql.conf and postgresql.auto.conf.
To work around the problem, this commit changes ProcessConfigFile so that
its first call processes only data_directory and the second one does all the
entries. It's OK to process data_directory in the first call because it's
ensured that data_directory doesn't exist in postgresql.auto.conf.

Back-patch to 9.4 where postgresql.auto.conf was added.

Patch by me. Review by Amit Kapila

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3e3f65973a3c94a699a1659254b89c4f77f0a6a7

Modified Files
--------------
src/backend/utils/misc/guc-file.l | 90 ++++++++++++++++++++++++++++++++-----
src/backend/utils/misc/guc.c | 7 +++
2 files changed, 85 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tatsuo Ishii 2014-08-12 08:36:41 pgsql: Enhance pgbench's option checking.
Previous Message Fujii Masao 2014-08-12 03:15:44 pgsql: Add tab-completion for \unset and valid setting values of psql v