Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6FF796350D6 for ; Wed, 5 Aug 2009 15:57:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 25648-03 for ; Wed, 5 Aug 2009 18:57:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail137077.authsmtp.com (outmail137077.authsmtp.com [62.13.137.77]) by mail.postgresql.org (Postfix) with ESMTP id 9FA53634C4E for ; Wed, 5 Aug 2009 15:57:22 -0300 (ADT) Received: from mail-c189.authsmtp.com (mail-c189.authsmtp.com [62.13.128.71]) by punt4.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n75IvKo4020088; Wed, 5 Aug 2009 19:57:20 +0100 (BST) Received: from Sidney-Stratton.local (dsl081-245-111.sfo1.dsl.speakeasy.net [64.81.245.111]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n75IvHbi064306; Wed, 5 Aug 2009 19:57:18 +0100 (BST) Message-ID: <4A79D60D.1090900@agliodbs.com> Date: Wed, 05 Aug 2009 11:57:17 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: Tom Lane CC: Petr Jelinek , PostgreSQL-development Subject: Re: GRANT ON ALL IN schema References: <4A37BF63.50008@pjmodos.net> <4A37E122.8070303@pjmodos.net> <4A38A956.8080600@pjmodos.net> <4A4DE104.8090605@pjmodos.net> <4A6059B4.5010004@pjmodos.net> <4A607997.3030305@pjmodos.net> <21542.1249492707@sss.pgh.pa.us> In-Reply-To: <21542.1249492707@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Server-Quench: cd308be4-81f1-11de-a90b-001f29070be2 X-AuthRoute: OCdyZgscClZXSx8a IioLCC5HRQ8+YBZL BAkGMA9GIUINWEQK c1ACcx16LVJbHwkB CnYKUl5RV1dwUC1z bxRZbBtfZk9QXgRr T0pMQFdNFEs2Bhl4 QGZMCxl0cwZGfjBz Z0BrECMPX0RyJxN5 X0ZVQ2wbZGY0PX1O WUAKagNUcVVIdx9C agIqVj1vNG8XDQIR NCweBQsEdRplAQJp CiYrZXs2ZQ4qOHYn TBAPGDxH X-Authentic-SMTP: 61633136333939.kestrel.dmpriest.net.uk:1849/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/347 X-Sequence-Number: 142990 Tom, > I took a quick look at this version of the patch. Other than the > already-mentioned question of whether we really want to create a > distinction between tables and views in GRANT, there's not that > much there to criticize. It's pretty common to have a database where there are some users who have permissions on views but not on the base tables. So that would be an argument for separating the two. On the other hand, it's not a very persuasive argument; in general, such databases have complex enough security rules that GRANT ALL ON is too simple for them. So, overall, I'd tend to say that we're better off including views and tables in the same GRANT ALL. The purpose of this is to be a simple approach for simple cases, no? > I do have a feeling that the implementation > is a bit too narrowly focused on the "stuff IN SCHEMA foo" case; > if we were ever to add other filtering options it seems like we'd > have to rip all this code out and start over. But I don't have any > immediate ideas on what it should look like instead. Well, schemas do make a good grouping set for objects of different security contexts; they are certainly more reliable than name fragments (as would be supported by a regex scheme). The main defect of schemas is the well-documented issues with managing search_path. > Other than that I don't have much to say. I wonder though if this > approach isn't sort of a dead-end, and we should instead look at > making it easier to build sql or plpgsql functions for doing bulk > grants with arbitrary selection conditions. Right now we have a situation where most web developers aren't using ROLEs *at all* because they are too complex for them to bother with. I literally couldn't count the number of production applications I've run across which connect to Postgres as the superuser. We need a dead-simple approach for the entry-level DB users, and I haven't heard one which is simpler or more approachable than the GRANT ALL + SET DEFAULT approach. With that approach, setting up a 3-role, table only database to have the right security is only 6 statements. I agree that we should also provide examples of how to do this by script in the docs, and maybe even some tools on pgFoundry. But those cover the sophisticated users. For the simple users, we need a dead-simple tool. -- Josh Berkus PostgreSQL Experts Inc. www.pgexperts.com