Re: can plpgsql returns more flexibe value ? - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: can plpgsql returns more flexibe value ?
Date
Msg-id 41F10E3D.2020606@familyhealth.com.au
Whole thread Raw
In response to can plpgsql returns more flexibe value ?  ("Arnold.Zhu" <joint@shaucon.com>)
List pgsql-hackers
> This problem annoys me, if I have more than several hundred function
> which returns different result set, like contains foreign keys, 
> I have to create many type for function's return.
> 
> Can plpgsql returns result set according to what exactly fetched,
> then take return type as references to store data for return.
> 
> Whether there is some better way to deal with this problem?

Yeah, you just make your function return 'SETOF record' and specify the 
types when you do the select:

select * from func() as (a int, b text);

Chris


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: ARC patent
Next
From: Manfred Koizar
Date:
Subject: Re: ARC patent