Re: pg_hba_lookup function to get all matching pg_hba.conf entries

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>
Cc: David Steele <david(at)pgmasters(dot)net>, Scott Mead <scottm(at)openscg(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_hba_lookup function to get all matching pg_hba.conf entries
Date: 2016-03-21 00:59:56
Message-ID: CAJrrPGfaE7A3cmNE6Y-EGVKTYTU=fTRm+p+S_EYtV7Zth3zbPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 18, 2016 at 7:46 PM, Shulgin, Oleksandr
<oleksandr(dot)shulgin(at)zalando(dot)de> wrote:
> On Fri, Mar 18, 2016 at 7:53 AM, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
> wrote:
>>
>> On Thu, Mar 17, 2016 at 6:56 PM, Shulgin, Oleksandr
>> <oleksandr(dot)shulgin(at)zalando(dot)de> wrote:
>> >
>> > You mean change context name and correct the comment? I didn't suggest
>> > to
>> > change the function name.
>>
>> Changed the context name and the comment only.
>
> Check.
>
> +} lookup_hba_line_context;
> ^^^^^ but why TAB here?

corrected. I am not sure why pg_indent is adding a tab here.

>> >> > Still remains an issue of representing special keywords in database
>> >> > and
>> >> > user_name fields, but there was no consensus about that though.
>> >>
>> >> How about adding keyword_database and keyword_user columns to listing
>> >> out the keywords. These columns will be populated only when the hba
>> >> line
>> >> contains any keywords.
>> >
>> >
>> > Hm... that could work too.
>>
>> Here I attached patch with the added two keyword columns.
>
> + if (!tok->quoted && strcmp(tok->string, "all") == 0)
>
> token_is_keyword(tok, "all") ?

updated.

>> During the testing with different IP comparison methods like 'samehost' or
>> 'samenet', the address details are not displayed. Is there any need of
>> showing the IP compare method also?
>
> Do you mean return "samehost/samenet/all" in the yet another keyword_address
> out parameter or something like that?

Yes, Currently other than IP/hostname, if the user specifies
samehost/samenet/all
keywords, currently these are not displayed. I feel adding another column of
keyword_address is worth.

Updated patch is attached.

Regards,
Hari Babu
Fujitsu Australia

Attachment Content-Type Size
pg-hba-lookup-21-03-2016.patch application/octet-stream 31.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-03-21 01:42:05 Re: Improve error handling in pltcl
Previous Message Tomas Vondra 2016-03-21 00:01:34 Re: Parallel Aggregate