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