On Fri, Jan 30, 2015 at 3:16 AM, Jim Nasby <
Jim.Nasby@bluetreble.com> wrote:
>
> On 1/29/15 6:19 AM, Fabrízio de Royes Mello wrote:
>>
>> Perhaps a fdw can't be the best choice, maybe a complete new SQL syntax to manipulate HBA entries like we did with ALTER SYSTEM. It's just some thoughts about it.
>
>
> Aside from Tom's concern about sets not being a good way to handle this (which I agree with), the idea of "editing" pg_hba.conf via SQL raises all the problems that were brought up when ALTER SYSTEM was being developed. One of the big problems is a question of how you can safely modify a text file that's full of comments and what-not. You'd need to address those issues if you hope to modify pg_hba.conf via SQL.
>
I think the big problem you are mentioning can be resolved in
a similar way as we have done for ALTER SYSTEM which is
to have a separate file (.auto.conf) for settings done via
ALTER SYSTEM command, do you see any major problem
with that approach.
Here one thing that is different is the format of pg_hba.conf file
which is quite different from postgresql.conf file, it seems to me
if want to handle this via ALTER SYSTEM we need to have
additional/different syntax.
For Example,
ALTER SYSTEM AUTH TYPE = <type_value> DATABASE = <value> ...
or
ALTER SYSTEM AUTH ...
In second syntax, user can mention the whole record. Internally we
need to validate the syntax and values.