Re: pg_hba_lookup function to get all matching pg_hba.conf entries - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: pg_hba_lookup function to get all matching pg_hba.conf entries
Date
Msg-id CAFj8pRBpi216e6Ds_BjEDM_xc_L8gJysupZ3TKddZcD-qjyJYA@mail.gmail.com
Whole thread Raw
In response to pg_hba_lookup function to get all matching pg_hba.conf entries  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Responses Re: pg_hba_lookup function to get all matching pg_hba.conf entries  (Haribabu Kommi <kommi.haribabu@gmail.com>)
List 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


pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: checkpointer continuous flushing
Next
From: Tom Lane
Date:
Subject: Re: PL/pgSQL, RAISE and error context