Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 762A5632667 for ; Mon, 10 Aug 2009 13:10:01 -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 00955-03 for ; Mon, 10 Aug 2009 16:09:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f206.google.com (mail-bw0-f206.google.com [209.85.218.206]) by mail.postgresql.org (Postfix) with ESMTP id 7F8D963256A for ; Mon, 10 Aug 2009 13:09:58 -0300 (ADT) Received: by bwz2 with SMTP id 2so2811847bwz.19 for ; Mon, 10 Aug 2009 09:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=uS14tX9dxw7ANxTpw9esSp4piARuffPjp9nzGihD2EE=; b=dcrW8QWcojdWWcsXZPAWRy3Z9Y8L/PaHhMY/DXMkrTv0YAHcpoNx4mZZqXww2cuNIc iv/B3VMVO1mRvbPwVSb/JMJUFb33EXbBjdsLOX41osPp5yCHHQkxGDy66BSZprjZDpDR Y7KtRQTnY83eGdlsRiLMkN9EIM2T5qsfXatKE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tydnqdggBRcjR4UH4R3Bhp26KxhfEDqUpYwOnXXJOwuYRQGdjDSkn77YuprpNxAQNR 8xegxL6z4uccbLrkuNJQc/XB5r7j+bus/3YE6JGfXuM9yQr1qBPjTf3Oh5jm5j9IIeWk Hc5zpReWLEO2dRQK+iiOEUbEzwlXtaRJ3jZ24= MIME-Version: 1.0 Received: by 10.223.122.204 with SMTP id m12mr958196far.73.1249920595946; Mon, 10 Aug 2009 09:09:55 -0700 (PDT) In-Reply-To: <3285.1249918596@sss.pgh.pa.us> 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> <3285.1249918596@sss.pgh.pa.us> Date: Mon, 10 Aug 2009 12:09:55 -0400 Message-ID: <603c8f070908100909m69b876cdt1723f2fbd2462a40@mail.gmail.com> Subject: Re: GRANT ON ALL IN schema From: Robert Haas To: Tom Lane Cc: Andrew Dunstan , Kevin Grittner , Peter Eisentraut , pgsql-hackers@postgresql.org, Nikhil Sontakke , Petr Jelinek , Stephen Frost Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/801 X-Sequence-Number: 143444 On Mon, Aug 10, 2009 at 11:36 AM, Tom Lane wrote: > 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. =A0I 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... I think it would be awfully handy to integrate some of the features of PL/pgsql into core SQL - especially variables, and also things like IF and FOR... but I'm not expecting it to happen any time soon, or maybe ever. ...Robert