Re: set-valued function called in context that cannot accept a set - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: set-valued function called in context that cannot accept a set
Date
Msg-id 49B18742.5030408@iol.ie
Whole thread Raw
In response to set-valued function called in context that cannot accept a set  ("Eric B. Ridge" <ebr@tcdi.com>)
Responses Re: set-valued function called in context that cannot accept a set
List pgsql-general
On 06/03/2009 19:53, Eric B. Ridge wrote:
> # select unnest2(ARRAY[1,2,3]), 'hi';
> ERROR:  set-valued function called in context that cannot accept a set
> CONTEXT:  PL/pgSQL function "unnest2" line 8 at return next

When a function returns SETOF something, you need to treat it as if it
were a table, thus:

   select * from unnest2(...);

HTH,

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: "Eric B. Ridge"
Date:
Subject: set-valued function called in context that cannot accept a set
Next
From: "Eric B. Ridge"
Date:
Subject: Re: set-valued function called in context that cannot accept a set