set returning function
От | Dennis Bjorklund |
---|---|
Тема | set returning function |
Дата | |
Msg-id | Pine.LNX.4.44.0505091208380.7072-100000@zigo.dhs.org обсуждение исходный текст |
Ответы |
Re: set returning function
Re: set returning function |
Список | pgsql-bugs |
An issue came up on irc. How come that this work: SELECT generate_series(0,1); but SELECT foo(0,1); does not, where foo is my own set returning function, like this example: CREATE FUNCTION foo(a int, b int) RETURNS setof int AS 'BEGIN RETURN NEXT a; RETURN NEXT b; RETURN; END' LANGUAGE plpgsql; As far as I can tell the generate_series() example is not supposed to work either. Kris Jurka showed me another example that do work in the same way as generate_series: CREATE FUNCTION bar(int, int) RETURNS setof int AS 'SELECT $1 UNION ALL SELECT $2;' LANGUAGE sql; So it seems that it's not just the type that decide how the function can be used, it's also the language the function is defined in. Bug? -- /Dennis Björklund
В списке pgsql-bugs по дате отправления: