Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 28FD4632374 for ; Fri, 7 Aug 2009 03:57:57 -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 90844-07 for ; Fri, 7 Aug 2009 06:57:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay.pcl-ipout01.plus.net (relay.pcl-ipout01.plus.net [212.159.7.99]) by mail.postgresql.org (Postfix) with ESMTP id 85B29632E1F for ; Fri, 7 Aug 2009 03:57:46 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAN5se0rUnw6R/2dsb2JhbADPYoQWBQ Received: from ptb-relay01.plus.net ([212.159.14.145]) by relay.pcl-ipout01.plus.net with ESMTP; 07 Aug 2009 07:57:44 +0100 Received: from [84.51.143.99] (helo=server3.office.archonet.com) by ptb-relay01.plus.net with esmtp (Exim) id 1MZJOa-0000dt-Af; Fri, 07 Aug 2009 07:57:44 +0100 Received: from dell36.office.archonet.com (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 3594F274062; Fri, 7 Aug 2009 07:57:43 +0100 (BST) Message-ID: <4A7BD066.3040109@archonet.com> Date: Fri, 07 Aug 2009 07:57:42 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: decibel CC: Tom Lane , Robert Haas , Stephen Frost , Nikhil Sontakke , Petr Jelinek , PostgreSQL-development Subject: Re: GRANT ON ALL IN schema References: <4A37BF63.50008@pjmodos.net> <4A38A956.8080600@pjmodos.net> <4A4DE104.8090605@pjmodos.net> <4A6059B4.5010004@pjmodos.net> <4A607997.3030305@pjmodos.net> <603c8f070907191628r6929055coe7627726a33ed143@mail.gmail.com> <603c8f070908050932m19e7db65u9dab6d8001c5a237@mail.gmail.com> <20810.1249490458@sss.pgh.pa.us> <603c8f070908050951s3e5df452se4c610f01b80bb7d@mail.gmail.com> <21246.1249491592@sss.pgh.pa.us> <60269721-937B-477F-BC5E-B71BA453E452@decibel.org> In-Reply-To: <60269721-937B-477F-BC5E-B71BA453E452@decibel.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 63b6f1eab68a8c46998fbe1eaa20eb37 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/504 X-Sequence-Number: 143147 decibel wrote: > In this specific case, I think there's enough demand to warrant a > built-in mechanism for granting, but if something like exec() is > built-in then the bar isn't as high for what the built-in GRANT > mechanism needs to handle. > > CREATE OR REPLACE FUNCTION tools.exec( > sql text > , echo boolean > ) RETURNS text LANGUAGE plpgsql AS $exec$ Perhaps another two functions too: list_all(objtype, schema_pattern, name_pattern) exec_for(objtype, schema_pattern, name_pattern, sql_with_markers) Obviously the third is a simple wrapper around the first two. -- Richard Huxton Archonet Ltd