Re: Return Record - Mailing list pgsql-general

From Antti Haapala
Subject Re: Return Record
Date
Msg-id Pine.GSO.4.55.0306081159190.25259@paju.oulu.fi
Whole thread Raw
In response to Re: Return Record  (Rory Campbell-Lange <rory@campbell-lange.net>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "Ron Mayer"
Date:
Subject: Re: [HACKERS] SAP and MySQL ... [and Benchmark]
Next
From: Sean Chittenden
Date:
Subject: Re: Anonymous CVS access