Обсуждение: How can I return multiple rows from a FUNCTION?

Поиск
Список
Период
Сортировка

How can I return multiple rows from a FUNCTION?

От
"Ed Cox"
Дата:
Is it possible to have a FUNCTION in Postgres that returns multiple rows?  Something like:
 
CREATE FUNCTION foo()
RETURNS ???
AS 'SELECT count(*) FROM bar'
LANGUAGE 'sql';
 
If not, can you suggest a way to encapsulate this functionality?  I'd like to keep all SQL code out of my GSP code.
 
Thanks very much,
Ed Cox