Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id AF02E634821 for ; Thu, 20 Aug 2009 15:57:59 -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 51034-07 for ; Thu, 20 Aug 2009 18:57:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from phoenix.advel.cz (phoenix.advel.cz [81.0.239.26]) by mail.postgresql.org (Postfix) with SMTP id 120FA632C52 for ; Thu, 20 Aug 2009 15:57:47 -0300 (ADT) Received: (qmail 32114 invoked from network); 20 Aug 2009 20:57:44 +0200 Received: from unknown (HELO ?10.12.0.96?) (88.103.48.48) by 192.168.1.50 with SMTP; 20 Aug 2009 20:57:44 +0200 Message-ID: <4A8D9CA0.1040607@pjmodos.net> Date: Thu, 20 Aug 2009 20:57:36 +0200 From: Petr Jelinek User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: PostgreSQL-development Subject: Re: GRANT ON ALL IN schema 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> <603c8f070908152051mbd1d706hb0e29f5cfaf2f151@mail.gmail.com> <4A87854B.3070707@dunslane.net> <1250427428.26280.2.camel@vanquo.pezone.net> <395.1250439160@sss.pgh.pa.us> In-Reply-To: <395.1250439160@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1250; format=flowed Content-Transfer-Encoding: 7bit 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/1457 X-Sequence-Number: 144100 Tom Lane napsal(a): > Peter Eisentraut writes: >> Well, I don't know if we really need to call it "lambda", but I fully >> expect to be able to use these "ad hoc functions" as part of other >> expressions. > > Why would you expect that? To be used in an expression, you'd also need > decoration to tell the function argument types, result type, volatility > properties, etc etc (your proposed lambda notation is far too > simplistic). I think you're moving the goalposts to a point where we'd > need ANOTHER, simpler, mechanism to accomplish the original intent. > And frankly, all of the user demand I've heard is for the latter not > the former. By the time you get into specifying function properties > you might as well just create a function. > I agree with Tom here, doing it the way Andrew and Tom agreed on will be *way* easier and will give us most of the benefit (as Heikki said "90% of the usability with 10% of the trouble"). I volunteer to do this feature too. The implementation as I see it would create function in pg_temp namespace, call it and then drop it. Any other implementation would imho mean rewriting procedure language api. I am unsure if we should try to make the name of the function unique, since it should not collide with anything if we allow just one statement at a time (transactional DDL wins again), or am I mistaken here ? Also do we want the LANGUAGE option to be at start or at the end or anywhere (like it's in CREATE FUNCTION). The reason I am asking this is that if we let user to put it on both sides then the LANGUAGE keyword can't be optional (what Dimitri Fontaine wanted). And last thing I am wondering is if we want to allow DO to return rows (probably by creating the function with SETOF record as return type) ? I am guessing not here since if user wants to run something often then he should crate a function. Otherwise this should be quite straightforward (I have working code already). -- Regards Petr Jelinek (PJMODOS)