Re: [GENERAL] array function problem

2008-03-16 Thread Tom Lane
tuanhoanganh <[EMAIL PROTECTED]> writes: > I call it by command > select temp.rowfromarray(string_to_array('1,2,3,4,5', ',')); > but it have error > ERROR: set-valued function called in context that cannot accept a set You need to say select * from temp.rowfromarray(string_to_array('1,2,3

[GENERAL] array function problem

2008-03-16 Thread tuanhoanganh
I have a array function CREATE OR REPLACE FUNCTION "temp".rowfromarray(text[]) RETURNS SETOF text AS $BODY$DECLARE _returntext; BEGIN for i in 1..array_upper($1,1) loop _return := $1[i]; return next _return; end loop; return; END;$BODY$ LANGUAGE 'plpgsql' VOL