pgsql: Change ParseConfigFp() so that it doesn't process unused entry o

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change ParseConfigFp() so that it doesn't process unused entry o
Date: 2014-08-06 06:08:20
Message-ID: E1XEuOa-0006xl-L9@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Change ParseConfigFp() so that it doesn't process unused entry of each parameter.

When more than one setting entries of same parameter exist in the
configuration file, PostgreSQL uses only entry appearing last in
configuration file scan. Since the other entries are not used,
ParseConfigFp() doesn't need to process them, but previously it did
that. This problematic behavior caused the configuration file scan
to detect invalid settings of unused entries (e.g., existence of
multiple entries of PGC_POSTMASTER parameter) and log the messages
complaining about them.

This commit changes the configuration file scan so that it processes
only last entry of each parameter.

Note that when multiple entries of same parameter exist both in
postgresql.conf and postgresql.auto.conf, unused entries in
postgresql.conf are still processed only at postmaster startup.

The problem has existed since old version, but a user is more likely
to encounter it since 9.4 where ALTER SYSTEM command was introduced.
So back-patch to 9.4.

Amit Kapila, slightly modified by me. Per report from Christoph Berg.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/cf6a9c3742a78414184a6e651e4cc7d239f8f2c4

Modified Files
--------------
src/backend/utils/misc/guc-file.l | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2014-08-06 12:16:04 pgsql: Refactor pg_receivexlog main loop code, for readability, take 2.
Previous Message Kevin Grittner 2014-08-05 19:18:59 pgsql: Fix typo in C comment.