CREATE FUNCTION cashint(int4) RETURNS text AS '
DECLARE
value ALIAS for $1;
result text;
BEGIN
result=value::text;
RETURN result;
END;
' LANGUAGE 'plpgsql';
select cashint(2);
cashint
---------
2
(1 row)
this is correct nut when I' trying to get an array as return value it
throws an error
CREATE FUNCTION cashint(int4) RETURNS text[] AS '
DECLARE
value ALIAS for $1;
result text[];
BEGIN
result[1]=value::text;
RETURN result;
END;
' LANGUAGE 'plpgsql';
select cashint(2);
NOTICE: plpgsql: ERROR during compile of cashint near line 5
ERROR: parse error at or near "["
Is an array in this use not supported or am I totally wrong?
Ewald