> Hello
...
> In my proposal I don't create any default variables. Result type is
> only virtual - I don't need write it to system directory. I thing it's
> better than using some specific predeclared type as RESULTTYPE OR
> RESULTSET.
How is this different from using OUT params and RETURNS SETOF RECORD ?
hannu=# CREATE FUNCTION outsetof2py(n integer, OUT i integer, OUT j
integer) RETURNS SETOF record
AS $$
for i in xrange(n):
yield {'i':i,'j':i*i}
$$
LANGUAGE plpythonu;
CREATE FUNCTION
hannu=# select * from outsetof2py(3);
i | j
---+---
0 | 0
1 | 1
2 | 4
(3 rows)
btw, this currently works for pl/python only in my local copy (still
testing for bugs), but similar declaration works fine for pl/pgsql
--------------
Hannu
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
No comments:
Post a Comment