Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6D70C6329BC for ; Mon, 10 Aug 2009 04:42:42 -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 20404-08 for ; Mon, 10 Aug 2009 07:42:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mail.postgresql.org (Postfix) with SMTP id 3402C632881 for ; Mon, 10 Aug 2009 04:42:39 -0300 (ADT) Received: (qmail invoked by alias); 10 Aug 2009 07:42:37 -0000 Received: from fsgw.f-secure.com (EHLO fsopti579.localnet) [193.110.108.33] by mail.gmx.net (mp039) with SMTP; 10 Aug 2009 09:42:37 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX1/uJ8hO8Nvu9z6+LTlEPqbcpo9jsW4CmMmfb8Qt60 iw9CUVaq8CUvYW From: Peter Eisentraut To: pgsql-hackers@postgresql.org Subject: Re: GRANT ON ALL IN schema Date: Mon, 10 Aug 2009 10:42:34 +0300 User-Agent: KMail/1.11.4 (Linux/2.6.26-2-686; KDE/4.2.4; i686; ; ) Cc: Tom Lane , Robert Haas , Stephen Frost , Nikhil Sontakke , Petr Jelinek References: <4A37BF63.50008@pjmodos.net> <603c8f070908050951s3e5df452se4c610f01b80bb7d@mail.gmail.com> <21246.1249491592@sss.pgh.pa.us> In-Reply-To: <21246.1249491592@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908101042.35024.peter_e@gmx.net> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.64 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/764 X-Sequence-Number: 143407 On Wednesday 05 August 2009 19:59:52 Tom Lane wrote: > Or maybe we are going at this the wrong way? Would it be better to try > harder to support the write-a-plpgsql-function approach? This would become much simpler if you could just execute plpgsql code instead of having to define a function around it. And perhaps if the plpgsql parser where a bit smarter. Example: RUN LANGUAGE plpgsql $$ FOR schema_name, table_name FROM information_schema.tables WHERE whatever LOOP GRANT ALL ON TABLE schema_name.table_name TO someuser; END LOOP $$;