Re: Providing catalog view to pg_hba.conf file - Patch submission

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, "Prabakaran, Vaishnavi" <vaishnavip(at)fast(dot)au(dot)fujitsu(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Subject: Re: Providing catalog view to pg_hba.conf file - Patch submission
Date: 2015-03-03 18:05:17
Message-ID: 54F5F7DD.8020501@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/3/15 9:08 AM, Greg Stark wrote:
> On Mon, Jun 30, 2014 at 8:06 AM, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com> wrote:
>> After sleeping on it, I realised that the code would return '{all}' for
>> 'all' in pg_hba.conf, but '{"all"}' for '"all"'. So it's not exactly
>> ambiguous, but I don't think it's especially useful for callers.
>
> Hm. Nope, it doesn't. It just says {all} regardless of whether "all"
> is quoted or not.
>
> This makes sense, the rules for when to quote things in pg_hba and
> when to quote things for arrays are separate. And we definitely don't
> want to start adding quotes to every token that the parser noted was
> quoted because then you'll start seeing things like {"\"all\""} and
> {"\"database with space\""} which won't make it any easier to match
> things.
>
> I'm not sure adding a separate column is really the solution either.
> You can have things like all,databasename (which is the keyword "all"
> not a database "all). Or more likely something like sameuser,bob or
> even things like replication,all.

What about a separate column that's just the text from pg_hba? Or is
that what you're opposed to?

FWIW, I'd say that having the individual array elements be correct is
more important than what the result of array_out is. That way you could
always do array_to_string(..., ', ') and get valid pg_hba output.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2015-03-03 18:15:32 Re: Patch: raise default for max_wal_segments to 1GB
Previous Message Peter Geoghegan 2015-03-03 17:56:12 Re: Abbreviated keys for text cost model fix