On Thu, 27 Feb 2003, Kolus Maximiliano wrote:
> > You can't return more than one return value from function, but that
> > value can be of composite type.For example :"setof text" or "setof record"
> > are such types.
>
> Can you use functions returning "setof"s as if they were "normal"
> selects?.
>
> I saw that setof takes a type or table as an argument. What if what
> i want to return is not in a table schema, can i do something like "setof
> (blah inet, blah2 varchar(256))"?
You might want to read the Set Returning Functions document on techdocs:
http://techdocs.postgresql.org/guides/SetReturningFunctions
The best answer is to define a row type for it with CREATE TYPE, but you
can also return setof record and rely on the user putting the type
information in the select.