Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 20917633C01 for ; Sat, 15 Aug 2009 20:15:55 -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 69245-08 for ; Sat, 15 Aug 2009 23:15:37 +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 738CD633970 for ; Sat, 15 Aug 2009 20:15:43 -0300 (ADT) Received: (qmail invoked by alias); 15 Aug 2009 23:15:40 -0000 Received: from a91-154-107-53.elisa-laajakaista.fi (EHLO [10.0.0.101]) [91.154.107.53] by mail.gmx.net (mp052) with SMTP; 16 Aug 2009 01:15:40 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX18AFs5DKxsAtiaoDDEHXaqhvLlPIN5DDauXaHXwuu BJSPnz2i1vU1Mu Subject: Re: GRANT ON ALL IN schema From: Peter Eisentraut To: Sam Mason Cc: pgsql-hackers@postgresql.org In-Reply-To: <20090815223102.GS5407@samason.me.uk> References: <603c8f070908050951s3e5df452se4c610f01b80bb7d@mail.gmail.com> <21246.1249491592@sss.pgh.pa.us> <200908101042.35024.peter_e@gmx.net> <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> Content-Type: text/plain; charset="UTF-8" Date: Sun, 16 Aug 2009 02:15:39 +0300 Message-Id: <1250378139.18992.6.camel@vanquo.pezone.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.57 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/1205 X-Sequence-Number: 143848 On lör, 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: > > > > DO [ [LANGUAGE] language] $$ ... $$; > > DO plperl $$ ... $$; > > DO language plpython $$ ... $$; > > > > language is optional and defaults to plpgsql. > > Yup, sounds nicer. The 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. E.g. SELECT LAMBDA $$ ... $$; -- if CALL is implemented CALL LAMBDA $$ ... $$; PREPARE foo AS SELECT LAMBDA $$ ... $$; EXECUTE foo; SELECT (LAMBDA (x int, y text) $$ ... $$) (37, 'foo');