Re: Parsing config files in a directory

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Parsing config files in a directory
Дата
Msg-id 407d949e0910272156t6d7f0af9veb64cd2a68f9431@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Parsing config files in a directory  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: Parsing config files in a directory  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список 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 по дате отправления:

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Parsing config files in a directory
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: operator exclusion constraints