Re: Options for select from function returning record? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Options for select from function returning record?
Date
Msg-id 20030611092407.L93562-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Options for select from function returning record?  (Rory Campbell-Lange <rory@campbell-lange.net>)
List pgsql-general
On Wed, 11 Jun 2003, Rory Campbell-Lange wrote:

> On 11/06/03, Stephan Szabo (sszabo@megazone23.bigpanda.com) wrote:
> >
> > On Wed, 11 Jun 2003, Rory Campbell-Lange wrote:
> >
> > > Also is it possible to ever truncate this sort of select as
> ...
> > > ommitting the "AS"?
> >
> > Not for a function returning records currently.  If the type is known and
> > constant, you can instead make a composite type with CREATE TYPE AS and
> > have the function return those rather than record.
>
> I thought that making a type makes the query simpler (for the client
> application). The example below uses the %rowtype row variable type (and
> works!). Is this a recommended approach?

Right now, I'd suggest it for any case where the result definition would
be known at function creation time rather than only at call time (for
example, this wouldn't make sense for dblink).


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] SAP and MySQL ... [and Benchmark]
Next
From: Stephan Szabo
Date:
Subject: Re: Return Record with CASE problem