From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Greg Stark <stark@mit.edu>
To: Abhijit Menon-Sen <ams@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Prabakaran, Vaishnavi <vaishnavip@fast.au.fujitsu.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Jaime Casanova <jaime@2ndquadrant.com>
Subject: Re: Providing catalog view to pg_hba.conf file - Patch submission
Date: Tue, 3 Mar 2015 12:05:17 -0600
Message-ID: <54F5F7DD.8020501@BlueTreble.com> (raw)
In-Reply-To: <CAM-w4HN6Mq7qAGwNKhM7Uy+f0UJHZkE3zNqBXnunoGRrh5C_Sg@mail.gmail.com>
References: <F40B0968DB0A904DA78A924E633BE78645FE29@SYDEXCHTMP2.au.fjanz.com>
<CABUevEwzKy5JR8papHw5Amk=Ok6uddYtwQ+gJntmLdrx2wOgbA@mail.gmail.com>
<82897A1301080E4B8E461DDAA0FFCF14DDE1@SYD1216>
<82897A1301080E4B8E461DDAA0FFCF14FD6E@SYD1216>
<20140629165554.GA5984@toroid.org>
<20140630070646.GY31357@toroid.org>
<CAM-w4HN6Mq7qAGwNKhM7Uy+f0UJHZkE3zNqBXnunoGRrh5C_Sg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 3/3/15 9:08 AM, Greg Stark wrote:
> On Mon, Jun 30, 2014 at 8:06 AM, Abhijit Menon-Sen <ams@2ndquadrant.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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: Jim.Nasby@BlueTreble.com, stark@mit.edu, ams@2ndquadrant.com, vaishnavip@fast.au.fujitsu.com, magnus@hagander.net, jaime@2ndquadrant.com
Subject: Re: Providing catalog view to pg_hba.conf file - Patch submission
In-Reply-To: <54F5F7DD.8020501@BlueTreble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox