Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id F33D7635D80 for ; Wed, 5 Aug 2009 15:41:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 53865-01-2 for ; Wed, 5 Aug 2009 18:41:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from phoenix.advel.cz (phoenix.advel.cz [81.0.239.26]) by mail.postgresql.org (Postfix) with SMTP id 6CBDE63507C for ; Wed, 5 Aug 2009 15:39:46 -0300 (ADT) Received: (qmail 5822 invoked from network); 5 Aug 2009 20:36:02 +0200 Received: from unknown (HELO ?10.12.0.96?) (88.103.48.48) by 192.168.1.50 with SMTP; 5 Aug 2009 20:36:02 +0200 Message-ID: <4A79D10A.8060003@pjmodos.net> Date: Wed, 05 Aug 2009 20:35:54 +0200 From: Petr Jelinek User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Tom Lane CC: 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=windows-1250; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.787 tagged_above=-10 required=5 tests=AWL=1.812, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/344 X-Sequence-Number: 142987 Tom Lane wrote: > 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. > It is, I was thinking about making that bool is_schema something more useful like int search_option with enum associated with it. But if I do that it would be better to have more then one filter implemented in initial commit - maybe I could add that OWNED BY I was talking about, or do you have better suggestions ? > You mentioned that you weren't having any luck making "SCHEMA" optional > in the syntax. I'm inclined to think it should be required rather than > leave it out entirely. Leaving it out seems like it risks foreclosing > future expansion --- are we sure there will never be another selection > option that we'd want to start with IN? > Ok I'll make it mandatory. > Putting the search functions (getNamespacesObjectsOids and > getRelationsInNamespace) into aclchk.c doesn't seem quite right. > I'd have been inclined to put them in namespace.c instead, I think. > On the other hand objectNamesToOids hasn't been abstracted at all, > so maybe this is fine as-is. > I wanted to be consistent with existing code there (the objectNamesToOids you mentioned) and I also didn't want to export those functions needlessly. > 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. > The whole reason for me to implement this thing is that I see something like "How can I grant rights to all existing objects in database?" question asked on irc channel like once a week. Most of the time those people only want to use that particular feature once after importing/creating schema so making function you'll only use once is not the optimal way to do it. And more importantly they expect this to be possible using standard SQL. -- Regards Petr Jelinek (PJMODOS)