Hi,
I've read in the mailing list archives that plpgsql does not support
assignment to array variables, so it is impossible to use them to
return data from a plpgsql function.
I'm curious as to how one might return more than one base type from
such a function, short of creating a temporary table and inserting the
value into that. For example:
CREATE TABLE tmp (a INTEGER, b INTEGER); --define the type
CREATE OR REPLACE FUNCTION frob()
RETURNS tmp AS '
DECLARE
ret tmp%ROWTYPE;
BEGIN
ret.a := 1;
ret.b := 2;
return ret;
END;'
LANGUAGE 'plpgsql';
Unfortunately, when I execute this, I get:
cal=> select frob();
frob
-----------
172795360
(1 row)
Is there some sort of type coercion I have to do to get this to work?
Thanks,
Joe