"Michele Petrazzo - Unipex srl" <michele.petrazzo@unipex.it> writes:
> I try with:
> CREATE FUNCTION getfoo (IN int, OUT int, OUT int) AS $$
>    SELECT fooid, foosubid FROM foo WHERE fooid = $1;
> $$ LANGUAGE SQL;
>
> but only one row returned...
You're almost there:
CREATE FUNCTION getfoo (IN int, OUT int, OUT int) returns setof record(int,int) AS $$ SELECT fooid, foosubid FROM foo
WHEREfooid = $1;
 
$$ LANGUAGE SQL;
The return type if present has to match the OUT (and BOTH) parameters.
--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Get trained by Bruce Momjian - ask me about
EnterpriseDB'sPostgreSQL training!