"Eliel Mamousette" <eliel@panix.com> writes:
> I have tried using the SETOF operand in the CREATE FUNCTION
> statement, and that allows me to return more than one row,
> but haven't had any luck with specifying more than one return
> type and hence more than one column.
You don't specify more than one return type --- you specify one return
type that is a composite type. Composite types are currently tied to
tables; creating a table also creates a type that represents one of its
rows. Thus
create table foo (a int, b int);
create function foobar (...) returns foo as ...
Note that there are some annoying syntactic limitations on what you can
actually *do* with a function returning tuples. We have plans to
improve that situation in 7.2 or beyond, but for now, this facility
isn't nearly as useful as one might think.
regards, tom lane