Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id AF8FC633EBC for ; Mon, 10 Aug 2009 12:38:45 -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 52395-01-8 for ; Mon, 10 Aug 2009 15:38:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B241D63256A for ; Mon, 10 Aug 2009 12:38:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n7AFaa5U003286; Mon, 10 Aug 2009 11:36:36 -0400 (EDT) To: Andrew Dunstan cc: Kevin Grittner , Peter Eisentraut , pgsql-hackers@postgresql.org, Nikhil Sontakke , Robert Haas , Petr Jelinek , Stephen Frost Subject: Re: GRANT ON ALL IN schema In-reply-to: <4A803A89.9020509@dunslane.net> References: <4A37BF63.50008@pjmodos.net> <603c8f070908050951s3e5df452se4c610f01b80bb7d@mail.gmail.com> <21246.1249491592@sss.pgh.pa.us> <200908101042.35024.peter_e@gmx.net> <4A7FE7F902000025000296E3@gw.wicourts.gov> <4A803A89.9020509@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Mon, 10 Aug 2009 11:19:37 -0400" Date: Mon, 10 Aug 2009 11:36:36 -0400 Message-ID: <3285.1249918596@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.326 tagged_above=-10 required=5 tests=AWL=1.273, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/794 X-Sequence-Number: 143437 Andrew Dunstan writes: > One fairly simple way would use a new SQL verb (say, DO) like this: > DO $$ something in plfoo $$ LANGUAGE plfoo; Yeah, this has been suggested before. I can't see anything very wrong with it. > We could even default the langauge to plpgsql, for which you would then > just need: > DO $$ something in plpgsql $$; Add a GUC variable to set the default language, perhaps? > But to make it really nice you'd have to move away from pl programs as > strings. That would be a lot more work, and you really wouldn't want to > make it work with more than one PL for the sake of everyone's sanity. That would be an awful lot of messiness to save four keystrokes... regards, tom lane