Re: pg_hba_file_settings view patch
Vitaly Burovoy <vitaly.burovoy@gmail.com>
From: Vitaly Burovoy <vitaly.burovoy@gmail.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>,
Simon Riggs <simon@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2016-10-03T07:53:09Z
Lists: pgsql-hackers
On 10/2/16, Michael Paquier <michael.paquier@gmail.com> wrote:
> On Mon, Oct 3, 2016 at 3:25 PM, Vitaly Burovoy <vitaly.burovoy@gmail.com>
> wrote:
>> I guess for ability to use filtering like:
>>
>> SELECT * FROM pg_hba_rules WHERE options->>radiusserver LIKE
>> '%.example.com';
>>
>> I think it would be harder if options is an array of strings...
>
> With unnest() and a matching pattern, not that hard but..
I'm not a user of that feature, and I don't know how pg_hba files look
like in really big companies...
But for me filtering is more complicated than just a single comparison.
What about more complex filtering --- several radiusserver and a user(s):
WHERE
options->>radiusserver = ANY(ARRAY['a.example.com', 'g.example.com'])
AND
options->>radiusidentifier = ANY(ARRAY['ID_a', 'ID_b', 'ID_c',
'ID_d', 'ID_e']) -- or even a subquery
Again, I don't know whether it will be widely used, but in case of
multiple param_name->param_value settings (column "options") I'd like
to see native key-value store rather than array of strings (according
to POLA).
I guess you're expecting "key=value" format as they are written in the
pg_hba file (and described in the doc), but sometimes they can be
parsed and output differs from exact pg_hba records (for instance look
at "ldapurl" parameter).
--
Best regards,
Vitaly Burovoy
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Invent pg_hba_file_rules view to show the content of pg_hba.conf.
- de16ab723888 10.0 landed
-
Restructure hba.c to replace 3 parallel lists with single list of structs.
- 350cb921ae2c 10.0 landed