Karl O. Pinc wrote:
> Thanks! I was not declaring the variable %rowtype.
> Adding that fixed the problem.
>
Ah yes, that works too. For the record:
CREATE TYPE returntype AS (a INT, b INT);
CREATE OR REPLACE FUNCTION return_multiple()
RETURNS returntype
LANGUAGE plpgsql
AS '
DECLARE
myvar returntype%rowtype;
BEGIN
myvar.a := 1;
myvar.b := 2;
RETURN myvar;
END;
';
SELECT * FROM return_multiple();
a | b
---+---
1 | 2
(1 row)
Joe