Re: GRANT ON ALL IN schema - Mailing list pgsql-hackers

From Sam Mason
Subject Re: GRANT ON ALL IN schema
Date
Msg-id 20090816014819.GT5407@samason.me.uk
Whole thread Raw
In response to Re: GRANT ON ALL IN schema  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Sun, Aug 16, 2009 at 02:15:39AM +0300, Peter Eisentraut wrote:
> On 2009-08-15 at 23:31 +0100, Sam Mason wrote:
> > 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 $$ ... $$;
[..]
> SELECT (LAMBDA (x int, y text) $$ ... $$) (37, 'foo');

I can't quite tell if you're being serious or not, you realize that this
leaves open the possibility of doing:
 SELECT t.n, f.op, f.fn(t.n) FROM generate_series(1,10) t(n), (VALUES    ('id',LAMBDA (_x int) $$ BEGIN; RETURN _x;
END;$$),   ('*2',LAMBDA (_x int) $$ BEGIN; RETURN _x*2; END; $$)) f(op,fn)
 

And of storing lambda abstractions in tables?

--  Sam  http://samason.me.uk/


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: [COMMITTERS] pgsql: Remove tabs from SGML.
Next
From: Robert Haas
Date:
Subject: Re: GRANT ON ALL IN schema