Re: array function problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: tuanhoanganh <hatuan05(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: array function problem
Date: 2008-03-17 04:50:54
Message-ID: 24127.1205729454@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

tuanhoanganh <hatuan05(at)gmail(dot)com> 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,4,5', ','));

plpgsql functions returning SETOF have to be called within the FROM
clause of a SELECT.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Rich 2008-03-17 07:13:55 8.3.0 upgrade
Previous Message tuanhoanganh 2008-03-17 04:37:16 array function problem