Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D0171633EBC for ; Sun, 16 Aug 2009 00:51:40 -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 85279-01 for ; Sun, 16 Aug 2009 03:51:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by mail.postgresql.org (Postfix) with ESMTP id 8B9AC6336F5 for ; Sun, 16 Aug 2009 00:51:33 -0300 (ADT) Received: by fxm28 with SMTP id 28so1807365fxm.41 for ; Sat, 15 Aug 2009 20:51:31 -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=YVsv9etaTgqtcg4nHtC80QvOU2eB7H1DnQIcQz5yE2g=; b=lVh1AknDB7Wafw4AKbyPw7U2ElGP6Q2yEk1FJifoS8JLQ6XOp5oNDatf8TxBXeECMa DYcU4Lho2LFfuOTqLwldnBMLDJZeXnF+QNc/8V1kmD01nTQ3325FRhMlkzj60FHryfZF ExPaYfOz3U9eqgvAOMCoioVi14yVuEdIq9T/M= 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=wfbCGSRtR5oE5xc8lGWRo3AeqPBfCMZY3ND/d1f5vMsYe6UD4sL71pJjGsVcwZeU6R GItqnjG5/scOOCbB8Gl4iPHqlxsOBxxX4HjJuY4mOP0FM4G/oaXkoxt55DXmBN2luDZd K4vBhp7D/0wr2aD7ZtxI+DoEBlAuhqSJCXnck= MIME-Version: 1.0 Received: by 10.223.124.65 with SMTP id t1mr694615far.21.1250394691843; Sat, 15 Aug 2009 20:51:31 -0700 (PDT) In-Reply-To: <1250378139.18992.6.camel@vanquo.pezone.net> References: <603c8f070908050951s3e5df452se4c610f01b80bb7d@mail.gmail.com> <4A7FE7F902000025000296E3@gw.wicourts.gov> <4A803A89.9020509@dunslane.net> <2CCE9C1D-919D-45D5-BFC2-C7723C45064E@hi-media.com> <162867790908150434j7aef36ecm202e81c4bb4740fa@mail.gmail.com> <4A86B5D5.6060807@dunslane.net> <4A871F46.1040002@agliodbs.com> <5D5ECAE0-F2B0-479B-9594-50AAF18F10ED@hi-media.com> <20090815223102.GS5407@samason.me.uk> <1250378139.18992.6.camel@vanquo.pezone.net> Date: Sat, 15 Aug 2009 23:51:31 -0400 Message-ID: <603c8f070908152051mbd1d706hb0e29f5cfaf2f151@mail.gmail.com> Subject: Re: GRANT ON ALL IN schema From: Robert Haas To: Peter Eisentraut Cc: Sam Mason , pgsql-hackers@postgresql.org 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/1214 X-Sequence-Number: 143857 On Sat, Aug 15, 2009 at 7:15 PM, Peter Eisentraut wrote: > On l=F6r, 2009-08-15 at 23:31 +0100, Sam Mason wrote: >> On Sat, Aug 15, 2009 at 11:34:04PM +0200, Dimitri Fontaine wrote: >> > Nitpicking dept, I think I prefer: >> > >> > =A0DO [ [LANGUAGE] language] $$ ... $$; >> > =A0DO plperl $$ ... $$; >> > =A0DO language plpython $$ ... $$; >> > >> > language is optional and defaults to plpgsql. >> >> Yup, sounds nicer. =A0The less globals the better! >> >> Next all you need is to be able to PREPARE them (and somehow access the >> parameters from execute) and you'll have nice local functions. :) > > Yeah, rather than just making up some new command for "execute this > string", this could be generalized as lambda expressions that could be > called whereever an expression is allowed. =A0E.g. > > SELECT LAMBDA $$ ... $$; > > -- if CALL is implemented > CALL LAMBDA $$ ... $$; > > PREPARE foo AS SELECT LAMBDA $$ ... $$; > EXECUTE foo; > > SELECT (LAMBDA (x int, y text) $$ ... $$) (37, 'foo'); I like this idea (although it might not be too easy to implement, not sure), but I think we could still use DO (which is shorter) for the verb. Lambda-calculus is cool, but "do" is nice and simple. ...Robert