Re: replace all with * in pg_hba.conf - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: replace all with * in pg_hba.conf
Date
Msg-id 3FE20B56.3000705@dunslane.net
Whole thread Raw
In response to Re: replace all with * in pg_hba.conf  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: replace all with * in pg_hba.conf  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:

> Peter Eisentraut wrote:
>
>> Andrew Dunstan wrote:
>>  
>>
>>> If people are happy with Tom's suggestion of using '*' instead of
>>> 'all' in pg_hba.conf I will prepare a patch for it.
>>>   
>>
>>
>> Well, while we're breaking stuff in the name of improvement, what 
>> about databases named "*" or databases with spaces in their names?
>>  
>>
>
> Good point. Perhaps we need to provide for an escaping mechanism in 
> the routines that parse the file, although personally I have little 
> sympathy for anyone who names a database '*'. I think it comes into 
> the category of "Doctor, it hurts when I do this" ... "Then stop doing 
> that." Spaces are a more likely problem, especially when we get W32 
> native users.


Looking at the code I discover that there is already provision covering 
spaces etc., because you can quote names. It's even documented ;-)

The minimal disturbance change might be to teach the parser to 
distinguish between a quoted 'all' and an unquoted 'all', and forget the 
'*' idea. Alternatively, do the same sort of thing, but replacing 'all' 
with '*'. A patch for the first would be quite tiny - similar for '*' 
except for extra doc and sample file changes.

cheers

andrew





pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: 7.4 include file conflict
Next
From: Gavin Sherry
Date:
Subject: Re: Why isn't DECLARE CURSOR ... FOR UPDATE supported?