From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | Kjetil Haaland <kjetil(dot)haaland(at)student(dot)uib(dot)no> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: function returning a row |
Date: | 2004-12-15 17:05:37 |
Message-ID: | 20041215170537.GB1266@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
On Wed, Dec 15, 2004 at 07:16:20AM -0800, Joe Conway wrote:
> Kjetil Haaland wrote:
>
> >this i have done, i can return a single value of my own type from the
> >function. So now i am wondering, is it possible to return a set of my
> >type? If it is possible, how do i do that?
>
> I haven't followed this thread from the beginning, but if I understand
> correctly, you have a custom scalar type, and you want to return a set
> of that type? You should be able to declare the function with
> "RETURNS setof alignres", and then implement it as an SRF. See for
> example normal_rand() in contrib/tablefunc.
See also "Returning Sets from C-Language Functions" in the "C-Language
Functions" section of the "Extending SQL" chapter in the documentation.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
From | Date | Subject | |
---|---|---|---|
Next Message | Kretschmer Andreas | 2004-12-15 18:04:17 | Re: \d output to a file |
Previous Message | Tom Lane | 2004-12-15 16:50:58 | Re: \d output to a file |