Re: Definition of return types for own functions?

Поиск
Список
Период
Сортировка
От Lexington Luthor
Тема Re: Definition of return types for own functions?
Дата
Msg-id efh2jn$hsa$1@sea.gmane.org
обсуждение исходный текст
Ответ на Definition of return types for own functions?  (Matthias.Pitzl@izb.de)
Список pgsql-general
Matthias.Pitzl@izb.de wrote:
> Is it possible to define a complex return type like a record in a function
> without having some table around with the needed structure of the return
> values?

Sure, you just have to specify the columns at select time instead (and
this is easy enough to wrap inside a view).

CREATE FUNCTION foo(TEXT) RETURNS SETOF RECORD AS '...' LANGUAGE 'plpgsql' ;

SELECT * FROM foo('bar') AS x(a,b,c,d) ;


Regards,
LL

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Dead Lock problem with 8.1.3
Следующее
От: Joost Kraaijeveld
Дата:
Сообщение: Re: Strange query results with invalid multibyte