Re: Return Value of a Function

From: Richard Huxton <dev(at)archonet(dot)com>
To: Terry Lee Tucker <terry(at)esc1(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Return Value of a Function
Date: 2004-02-02 15:36:00
Message-ID: 200402021536.00027.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 02 February 2004 14:36, Terry Lee Tucker wrote:
>
> I may have several other things wrong with this function, so my real
> question is, "Can I return a value of type RECORD?"

Yes, but you can't necessarily do anything with it (unless you're calling it
from another function).

You could return a SETOF myrowtype where the set contains only one row -
that's probably what you're after. Then you can do things like:

SELECT * FROM set_returning_function(1,'a');

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2004-02-02 16:35:49 Re: Are there commands to enquire about table structure?
Previous Message harjan 2004-02-02 15:35:57 cannot extend error