Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YtFb3-0000tA-Jm for pgsql-hackers@arkaria.postgresql.org; Fri, 15 May 2015 13:24:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YtFb2-0004u7-ML for pgsql-hackers@arkaria.postgresql.org; Fri, 15 May 2015 13:24:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YtFb1-0004tu-5s for pgsql-hackers@postgresql.org; Fri, 15 May 2015 13:24:11 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YtFax-00012i-VB for pgsql-hackers@postgresql.org; Fri, 15 May 2015 13:24:09 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 3E1495F7B4; Fri, 15 May 2015 09:24:07 -0400 (EDT) Date: Fri, 15 May 2015 09:24:07 -0400 From: Stephen Frost To: Haribabu Kommi Cc: Peter Eisentraut , Andres Freund , Greg Stark , Pavel Stehule , Abhijit Menon-Sen , PostgreSQL-development Subject: Re: Providing catalog view to pg_hba.conf file - Patch submission Message-ID: <20150515132407.GU30322@tamriel.snowman.net> References: <55024C6C.6000207@gmx.net> <20150501163358.GE16366@awork2.anarazel.de> <5547DB0A.2020904@gmx.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="U1BX1qUcBI2yZxll" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-46-generic (x86_64) X-Uptime: 09:15:57 up 56 days, 19:04, 10 users, load average: 0.01, 0.06, 0.12 User-Agent: Mutt/1.5.21 (2010-09-15) 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 --U1BX1qUcBI2yZxll Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Haribabu Kommi (kommi.haribabu@gmail.com) wrote: > On Tue, May 5, 2015 at 6:48 AM, Peter Eisentraut wrote: > > On 5/1/15 12:33 PM, Andres Freund wrote: > >> On 2015-04-08 19:19:29 +0100, Greg Stark wrote: > >>> I'm not sure what the best way to handle the hand-off from patch > >>> contribution to reviewer/committer. If I start tweaking things then > >>> you send in a new version it's actually more work to resolve the > >>> conflicts. I think at this point it's easiest if I just take it from > >>> here. > >> > >> Are you intending to commit this? > > > > It still looks quite dubious to me. > > > > The more I test this, the more fond I grow of the idea of having this > > information available in SQL. But I'm also growing more perplexed by > > how this the file is mapped to a table. It just isn't a good match. > > > > For instance: What is keyword_databases? Why is it an array? Same for > > keyword_users. How can I know whether a given database or user matches > > a keyword? What is compare_method? (Should perhaps be > > keyword_address?) Why is compare method set to "mask" when a hostname > > is set? (Column order is also a bit confusing here.) I'd also like > > options to be jsonb instead of a text array. >=20 > Thanks for your suggestion. I am not sure how to use jsonb here, i > will study the same > and provide a patch for the next version. Regarding "next version"- are you referring to 9.6 and therefore we should go ahead and bounce this to the next CF, or were you planning to post a "next version" of the patch today? This is certainly a capability which I'd like to see, though I share Peter's concerns regarding the splitting up of the keywords rather than keeping the same structure as what's in the actual pg_hba.conf. That strikes me as confusing. It'd be neat if we were able to change pg_hba.conf to make more sense and then perhaps the SQL version wouldn't look so different but I don't think there's any way to do that. I discussed the patch briefing with Greg over IM, who pointed out that keeping things just exactly as they are in the config file would mean implementing, essentially, a pg_hba.conf parser in SQL. I can understand that perspective, but I don't think there's really much hope in users being able to use this view directly without a lot of effort, regardless. We need to provide a function which takes the arguments that our pg_hba lookup does (database, user-to-login-as, maybe system user for pg_ident checks, optionally an IP, etc) and then returns the record that matches. Apologies for not being able to provide more feedback earlier. I'll be happy to help with all of the above and review the patch. Independently, I'd love to see an SQL interface to pg_ident.conf too, where, I expect anyway, it'll be a lot simpler, though I'm not sure that it's very useful until we also have pg_hba.conf available through SQL. Thanks! Stephen --U1BX1qUcBI2yZxll Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVVfN2AAoJEO1sijiDR2RVXbsP/jiLLBA55j2CFk9QI6tMftEs tEFqRGlygT8pifA2ZSfy+csl8zOjjCnK2pi9oMtiy1i0WTJWLWQuIsYAOgBqD9yU NTdpl0J9+yC7YNizWUbxZjTuYCDEdLMozfre+kcpa9AehJvAgAFT3CUZkzzsEgl6 DeZVL6C9Z92xS0RmF88REapKixVq48D4sjo10OAFIousisD5rtHCUxb8MdAQnaUa nkj85ih8WdMlD/zRZoxvd3JFm8UdZ/vKhvwvWMsW/cvrZGrtdb8umX6OapysNB/7 lmW2FYOeR9bJkmFPdhhFUYMG9p58ckLhvdYTbrBzD6AUOuJfM/NHheL+gLj2X4Sm OWA+FQqYwFIHzCErLPBZpaykiEzY3AxylzbN2ldyMD8cVGuOdLzfLuEGJ36Lev2L oPdF/Z5mreBky/ijeReTOsXCb5l9RA/sjnRtAQ80B4PBc2XC52GSHMdRM0IrIO3I nAnRo3ildR5zvwYi5far4uIYOUbNQBAHiueQEKBe/f2lkXpKJhwzpxdOYBo0F0L0 FICq6puAGXZBcfMV4ndhG+qKQPQVViS+WS4rHDnCchsuXQo6qObQf/0CM48IuZhn VncNGgZMjWW5W3ghkHZmN3qh76H+3Q4nsHmsOBWm+nbi7Sh7v0SAeiMh1nQCbxEC /KFOwI5yce0kE6TogRss =NIfi -----END PGP SIGNATURE----- --U1BX1qUcBI2yZxll--