From: | Sam Mason <sam(at)samason(dot)me(dot)uk> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: GRANT ON ALL IN schema |
Date: | 2009-08-16 01:48:19 |
Message-ID: | 20090816014819.GT5407@samason.me.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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/
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2009-08-16 03:51:31 | Re: GRANT ON ALL IN schema |
Previous Message | David Fetter | 2009-08-16 00:47:18 | Re: [COMMITTERS] pgsql: Remove tabs from SGML. |