From: | Greg Stark <gsstark(at)mit(dot)edu> |
---|---|
To: | Christoph Haller <ch(at)rodos(dot)fzk(dot)de> |
Cc: | pgsql-sql(at)postgresql(dot)org, fernando(at)icreativa(dot)com(dot)mx, gsstark(at)MIT(dot)EDU |
Subject: | Re: SETOF |
Date: | 2003-03-05 13:36:29 |
Message-ID: | 87u1ei7x5u.fsf@stark.dyndns.tv |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Christoph Haller <ch(at)rodos(dot)fzk(dot)de> writes:
> >
> >
> > Christoph Haller <ch(at)rodos(dot)fzk(dot)de> writes:
> >
> > > You cannot obtain several columns from SQL functions.
> > > See the list archives (search for SETOF) for details.
> > > You have to use e.g. a plpgsql function instead.
> >
> > How do you do it with a plpgsql function?
>
> And Greg, refer to
> http://techdocs.postgresql.org/guides/SetReturningFunctions
>
> I think it will fit your needs.
That document describes using the function in the from list of the select.
That's equivalent to converting the query to a join, which isn't always
possible or convenient. I was talking about using a subquery or function in
the output column list to produce multiple output columns.
I'm sorry I may have muddied the waters in that it sounds like my comment
wasn't about exactly the same issue as Chistoph's.
--
greg
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Stark | 2003-03-05 13:37:11 | Re: SETOF |
Previous Message | Christoph Haller | 2003-03-05 13:24:27 | Re: LIMIT and SUBQUERIES |