Re: postgresql.conf: patch to have ParseConfigFile report all parsing errors, then bail - Mailing list pgsql-hackers

From Tom Lane
Subject Re: postgresql.conf: patch to have ParseConfigFile report all parsing errors, then bail
Date
Msg-id 8118.1238162851@sss.pgh.pa.us
Whole thread Raw
In response to postgresql.conf: patch to have ParseConfigFile report all parsing errors, then bail  (Selena Deckelmann <selena@endpoint.com>)
List pgsql-hackers
Selena Deckelmann <selena@endpoint.com> writes:
> ParseConfigFile currently exits on the first parsing error. Changed 
> guc_file.l to report all parsing errors before exiting:

This seems like basically a good idea, but consider what happens if
you make a really major-league screwup in your postgresql.conf
(say, you accidentally copy the text of "War and Peace" into it).
You'll get megabytes of mostly-useless bleating in your log file.
Multiply that by the number of active backends, if you're unlucky
enough to have done it at log level DEBUG2.  And not only are you
bloating your log, but it's going to take a fair amount of time
for all the backends to read and complain (or not) about the whole
file.

So I think a couple of safety valves would be prudent:

1. If IsUnderPostmaster, fall out after the first error, same as now.

2. Even in the postmaster, count the number of errors reported,
and give up after say 100.  By that point it's much more likely
that you're reading War and Peace than that you're continuing to
contribute to the enlightenment of the DBA.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gabriele Bartolini
Date:
Subject: Re: Mentors needed urgently for SoC & PostgreSQL Student Internships
Next
From: Tom Lane
Date:
Subject: Re: New trigger option of pg_standby