From: Petr Jelinek <pjmodos@pjmodos.net>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: GRANT ON ALL IN schema
Date: Thu, 20 Aug 2009 20:57:36 +0200
Message-ID: <4A8D9CA0.1040607@pjmodos.net> (raw)
In-Reply-To: <395.1250439160@sss.pgh.pa.us>
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>
Tom Lane napsal(a):
> Peter Eisentraut <peter_e@gmx.net> 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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pjmodos@pjmodos.net
Subject: Re: GRANT ON ALL IN schema
In-Reply-To: <4A8D9CA0.1040607@pjmodos.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox