Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YSrCW-00037M-J8 for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2015 18:05:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YSrCV-0007DY-R0 for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2015 18:05:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YSrCV-0007DQ-03 for pgsql-hackers@postgresql.org; Tue, 03 Mar 2015 18:05:47 +0000 Received: from mail-bn1bon0680.outbound.protection.outlook.com ([2a01:111:f400:fc10::1:680] helo=na01-bn1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YSrCK-0005fJ-Nj for pgsql-hackers@postgresql.org; Tue, 03 Mar 2015 18:05:44 +0000 Received: from decina.attlocal.net (2602:306:ce8b:3460:1852:6c4e:e316:262a) by DM2PR11MB0349.namprd11.prod.outlook.com (25.160.136.155) with Microsoft SMTP Server (TLS) id 15.1.99.14; Tue, 3 Mar 2015 18:05:28 +0000 Message-ID: <54F5F7DD.8020501@BlueTreble.com> Date: Tue, 3 Mar 2015 12:05:17 -0600 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Greg Stark , Abhijit Menon-Sen CC: PostgreSQL-development , "Prabakaran, Vaishnavi" , Magnus Hagander , Jaime Casanova Subject: Re: Providing catalog view to pg_hba.conf file - Patch submission References: <82897A1301080E4B8E461DDAA0FFCF14DDE1@SYD1216> <82897A1301080E4B8E461DDAA0FFCF14FD6E@SYD1216> <20140629165554.GA5984@toroid.org> <20140630070646.GY31357@toroid.org> In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2602:306:ce8b:3460:1852:6c4e:e316:262a] X-ClientProxiedBy: CY1PR0601CA0028.namprd06.prod.outlook.com (25.160.162.38) To DM2PR11MB0349.namprd11.prod.outlook.com (25.160.136.155) Authentication-Results: 2ndquadrant.com; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR11MB0349; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006); SRVR:DM2PR11MB0349; BCL:0; PCL:0; RULEID:; SRVR:DM2PR11MB0349; X-Forefront-PRVS: 0504F29D72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(479174004)(24454002)(377454003)(51704005)(64126003)(2171001)(87976001)(65806001)(47776003)(46102003)(42186005)(53416004)(65956001)(122386002)(93886004)(33656002)(50466002)(62966003)(77156002)(86362001)(50986999)(65816999)(54356999)(76176999)(87266999)(92566002)(15975445007)(59896002)(2950100001)(19580395003)(83506001)(80316001)(23676002)(19580405001)(40100003)(36756003)(3826002)(85282002)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR11MB0349; H:decina.attlocal.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2015 18:05:28.0178 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR11MB0349 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 3/3/15 9:08 AM, Greg Stark wrote: > On Mon, Jun 30, 2014 at 8:06 AM, Abhijit Menon-Sen 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