On Fri, 6 Jun 2003, Rory Campbell-Lange wrote:
> On 06/06/03, Rory Campbell-Lange (rory@campbell-lange.net) wrote:
> > I'm not clear on how to handle returning a record from a function.
> > I have planned a function that is handed two strings and returns two
> > integers. I need to return errors that satisfy the return type. At the
> > moment my "RETURN 0;" lines result in "return type mismatch..." errors.
>
> I've found a userful resource on postgresql.org:
>
> "PostgreSQL 7.3 Set Returning Functions":
> http://techdocs.postgresql.org/guides/SetReturningFunctions
>
> However I'm still having trouble living up to the title of the article!
>
> The error I'm getting is:
> temporary=> select fn_b1_login('email@email', 'pass');
> WARNING: Error occurred while executing PL/pgSQL function fn_b1_login
> WARNING: while casting return value to function's return type
> ERROR: Set-valued function called in context that cannot accept a set
*sigh*
temporary=> select * from fn_b1_login('email@email', 'pass');
--
Antti Haapala