Re: can plpgsql returns more flexibe value ?

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: "Arnold(dot)Zhu" <joint(at)shaucon(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: can plpgsql returns more flexibe value ?
Date: 2005-01-21 14:14:21
Message-ID: 41F10E3D.2020606@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Manfred Koizar 2005-01-21 14:42:38 Re: ARC patent
Previous Message Arnold.Zhu 2005-01-21 12:27:37 can plpgsql returns more flexibe value ?