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-03T06:25:56Z
Lists: pgsql-hackers
On 10/2/16, Michael Paquier <michael.paquier@gmail.com> wrote:
> +       push_jsonb_string_key(&parseState, "map");
> +       push_jsonb_string_value(&parseState, hba->usermap);
> [...]
> +    <row>
> +     <entry><structfield>options</structfield></entry>
> +     <entry><type>jsonb</type></entry>
> +     <entry>Configuration options set for authentication method</entry>
> +    </row>
> Why is it an advantage to use jsonb here instead of a simple array
> made of name=value? If they were nested I'd see a case for it but it
> seems to me that as presented this is just an overkill.

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...

-- 
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 →
  1. Invent pg_hba_file_rules view to show the content of pg_hba.conf.

  2. Restructure hba.c to replace 3 parallel lists with single list of structs.