Re: Howto return values from a function

From: Richard Huxton <dev(at)archonet(dot)com>
To: A B <gentosaker(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Howto return values from a function
Date: 2008-05-16 08:19:37
Message-ID: 482D4399.3090501@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A B wrote:
>> How you generate the results is up to you. when you have them you
>> either use RETURN NEXT or RETURN QUERY to return them to the caller.
>
> Now I get the reply
>
> ERROR: set-valued function called in context that cannot accept a set
> CONTEXT: PL/pgSQL function "actionlist" line 11 at return next

It's a source of rows, so you need to treat it like a table or a view:

SELECT * FROM actionlist(...);

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2008-05-16 08:23:18 Re: psql proxy
Previous Message Pavel Stehule 2008-05-16 08:17:59 Re: Howto return values from a function