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

From Andrew Dunstan
Subject Re: Parsing config files in a directory
Date
Msg-id 4AE990F6.4030709@dunslane.net
Whole thread Raw
In response to Re: Parsing config files in a directory  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Parsing config files in a directory  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Parsing config files in a directory  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers

Pavel Stehule wrote:
> 2009/10/29 Andrew Dunstan <andrew@dunslane.net>:
>   
>> Pavel Stehule wrote:
>>     
>>> 2009/10/27 Simon Riggs <simon@2ndquadrant.com>:
>>>
>>>       
>>>> On Tue, 2009-10-27 at 00:38 -0400, Greg Smith wrote:
>>>>
>>>>         
>>>>> new feature
>>>>>
>>>>>           
>>>> One additional point that would be useful is a way to match up the usage
>>>> of custom_variable_classes with this new style of .conf file processing.
>>>>
>>>> At the moment if you wish to add a custom variable class everybody needs
>>>> to edit the *same* parameter. Finding which one to edit could be a
>>>> little difficult with a whole directory to search in.
>>>>
>>>> I propose a new form of processing for that variable: each new parameter
>>>> instance is added to last one, rather than replacing it.
>>>> e.g.
>>>> custom_variable_class = 'x'
>>>> custom_variable_class = 'y'
>>>> custom_variable_class = 'z'
>>>> is equivalent to
>>>> custom_variable_classes = 'x,y,z'
>>>>
>>>> That allows NewFeatureX to drop in a file called "newfeaturex.conf",
>>>> which looks like this
>>>>
>>>> custom_variable_class = 'newfeaturex'
>>>> newfeaturex.param1 = x
>>>> newfeaturex.param2 = y
>>>> newfeaturex.param3 = z
>>>>
>>>> This requires no editing of any other files, just a straight drop in.
>>>> That will make it much easier to produce real installers/deinstallers
>>>> for add-in modules.
>>>>
>>>>         
>>> I understand, but this behave is confusing. Maybe better is using some
>>> trivial keywords like append, delete, reset
>>>
>>> so
>>> append custom_variable_class = 'x'
>>> append custom_variable_class = 'y'
>>> append custom_variable_class = 'z'
>>>
>>> is custom_variable_classes = 'x,y,z'
>>>
>>>
>>>       
>> Why not allow something like += or .= instead of the = to denote appending
>> to a list?
>>
>>   custom_variable_classes += 'x'
>>
>> seems a whole lot nicer to me.
>>
>>     
> -1
>
> not all people knows C like languages. I don't thing so this is
> readable for non programmers.
>
>   

Really, they don't know any Perl or Python or Java either? Maybe.

Anyway, it seems to me a whole lot better than inventing a new thing  
that makes "custom_variable_class" as something to append to 
"custom_variable_classes". If you're going to insist on using "append 
foo = 'x'" at least let it apply to the list that is actually being 
appended to, so we don't need to keep track of singular and plural 
forms. That's the part of your suggestion I really object to.

cheers

andrew


pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: Parsing config files in a directory
Next
From: Peter Eisentraut
Date:
Subject: Re: Show schema size with \dn+