Search Postgresql Archives

Re: Definition of return types for own functions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthias.Pitzl@xxxxxx 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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux