Re: pg_hba.conf additional comment re local line - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: pg_hba.conf additional comment re local line
Date
Msg-id 4150B0F5.4020404@dunslane.net
Whole thread Raw
In response to Re: pg_hba.conf additional comment re local line  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> writes:
>
>
>>The attached tiny patch will possibly help to avoid some confusion by
>>Windows users about the "local" line in pg_hba.conf (and thus help
>>reduce queries to us ;-) ).
>>
>>
>
>I was wondering if we could teach initdb to remove that line altogether
>in Windows installations.
>
>
>

See later email.

Of course it can be done. Probably the simplest way is a new small
routine called, say filter_token, which would remove lines containing a
given token:

  static char **filter_token(char **lines, char *token);

Then we could have something like:

#ifdef WIN32 (orwhatever we are calling it now)
    conflines = filter_token(conflines,"@remove-line-for-win32@");
#else
    conflines = replace_token(conflines, "@remove-line-for-win32@","");
#endif

Incidentally, even Unix users frequently get confused about the "local"
line - one of the commonest newbie mistakes is to think it means
localhost. So marking it clearly as being for Unix domain sockets would
still be a Good Thing (tm).

cheers

andrew

>            regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: don't forget to increase your free space map settings
>
>
>

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_hba.conf additional comment re local line
Next
From: Neil Conway
Date:
Subject: Re: pg_controldata usage