Re: proposal: a validator for configuration files - Mailing list pgsql-hackers

From Alexey Klyukin
Subject Re: proposal: a validator for configuration files
Date
Msg-id 1CB981C4-18BD-41EE-9703-26DF4CBF3593@commandprompt.com
Whole thread Raw
In response to Re: proposal: a validator for configuration files  (Florian Pflug <fgp@phlo.org>)
Responses Re: proposal: a validator for configuration files
List pgsql-hackers
Hi,

On Jun 16, 2011, at 9:18 PM, Florian Pflug wrote:

> On Jun16, 2011, at 20:14 , Alexey Klyukin wrote:
>>
>> Well, while thinking about this I decided to leave the counter for the ParseConfigFp, but
>> drop it in ProcessConfigFile. The case we are protecting against is a single file full of junk.
>> It's unlikely that this junk would contain include directives with valid file paths, neither it's
>> likely to find a file with a correct syntax, but full of invalid directives.
>
> Sounds good.


Attached is the v2 of the patch to show all parse errors at postgresql.conf.
Changes (per review and suggestions from Florian):

- do not stop on the first error during postmaster's start.
- fix errors in processing files from include directives.
- show only a single syntax error per line, i.e. fast forward to the EOL after coming across the first one.
- additional comments/error messages, code cleanup

Questions:

- Should we add a comment for the changes in guc.c? I think the existing ones are still valid, but they might be harder
gograsp, given that we've removed PGC_SIGHUP from the condition. 
- The error message that we emit when the parsing is unsuccessful, will it cause incompatibility w/ 3rd party tools,
whichmay, in theory, show only one error message (would it better to show the first error instead, as proposed by
Florian?).

I'd appreciate your comments and suggestions.

Thank you,
Alexey.

--
Command Prompt, Inc.                              http://www.CommandPrompt.com
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Nested CASE-WHEN scoping
Next
From: Peter Eisentraut
Date:
Subject: Re: gcc 4.6 -Wunused-but-set-variable