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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
Cc: "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: 2015-09-06 18:34:56
Message-ID: CAFj8pRBpi216e6Ds_BjEDM_xc_L8gJysupZ3TKddZcD-qjyJYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

> postgres=# select pg_hba_lookup('postgres','all');
> pg_hba_lookup
> -------------------------------------------------------
> (84,local,"[""all""]","[""all""]",,,trust,{})
> (86,host,"[""all""]","[""all""]",127.0.0.1,,trust,{})
> (88,host,"[""all""]","[""all""]",::1,,trust,{})
>
> Here I attached a proof of concept patch for the same.
>
> Any suggestions/comments on this proposed approach?
>
>
If I understand well to your proposal, the major benefit is in
impossibility to enter pg_hba keywords - so you don't need to analyse if
parameter is keyword or not? It has sense, although It can be hard to do
image about pg_hba conf from these partial views.

There can be other way - theoretically we can have a function pg_hba_debug
with similar API like pg_hba_conf. The result will be a content of
pg_hba.conf with information about result of any rule.

Regards

Pavel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-09-06 18:58:47 Re: PL/pgSQL, RAISE and error context
Previous Message Fabien COELHO 2015-09-06 18:31:12 Re: checkpointer continuous flushing