Re: Parsing config files in a directory - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Parsing config files in a directory
Date
Msg-id 407d949e0910272156t6d7f0af9veb64cd2a68f9431@mail.gmail.com
Whole thread Raw
In response to Re: Parsing config files in a directory  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Parsing config files in a directory
List pgsql-hackers
On Tue, Oct 27, 2009 at 8:40 PM, Josh Berkus <josh@agliodbs.com> wrote:
> You're hearing from the people who are working on tools: requiring that
> any tool parse a hand-written config file is a non-starter.

It can be done, pgadmin actually does it currently. But I totally
agree it's a bad idea.

But the difficulty of parsing the handwritten stuff is not the only
reason it's a bad idea. Any time you have multiple pieces of software,
to say nothing of humans, editing the same file you're going to have
headaches. They need to agree on everything and be able to handle
anything any other program generates. Such a file would be a kind of
API itself.

It's much simpler and more reliable to have each program generate a
separate file. Each program can just do its calculations and dump out
a file with those variables. It doesn't have to worry about the
ordering, indentation, or precise formatting. It can put whatever
comments it wants to explain how they're calculated or to warn that
it's an auto-generated file and any changes will be replaced the next
time it's generated. It doesn't have to worry about anything else
parsing or making sense of the file except the database server itself.

-- 
greg


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Parsing config files in a directory
Next
From: Jeff Davis
Date:
Subject: Re: operator exclusion constraints