This is the patch adds a new function called pg_hba_lookup to get all matching entries from the pg_hba.conf for the providing input data.The rows are displayed from the other the hba conf entries are matched.
This is an updated version of previous failure attempt to create a catalog view for the pg_hba.conf [1]. The view is not able to handle the SQL queries properly because keywords that are present in database and user columns.
After testing your prototype I am thinking so it is not good way. It is hard to understand what is result of these functions.
-1 from me
Regards
Pavel
How it works:
With the provided input data, it tries to match the entries of pg_hba.conf and populate the result set with all matching entries.
With the recent Tomlane's commit 1e24cf645d24aab3ea39a9d259897fd0cae4e4b6 of "Don't leave pg_hba and pg_ident data lying around in running backends" [2], the parsed hba conf entries are not available in the backend side. Temporarily I just reverted this patch for the proof of concept purpose. Once we agree with the approach, I will try to find out a solution to the same.
How is it useful:
With the output of this view, administrator can identify the lines that are matching for the given criteria easily without going through the file.
Record format:
Column name | datatype ------------------------------- line_number | int4 type | text database | jsonb user | jsonb address | inet hostname | text method | text options | jsonb
Please suggest me for any column additions or data type changes that are required.