Re: SETOF

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: SETOF
Дата
Msg-id 87u1ei7x5u.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на Re: SETOF  (Christoph Haller <ch@rodos.fzk.de>)
Список pgsql-sql
Christoph Haller <ch@rodos.fzk.de> writes:

> >
> >
> > Christoph Haller <ch@rodos.fzk.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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Christoph Haller
Дата:
Сообщение: Re: LIMIT and SUBQUERIES
Следующее
От: Greg Stark
Дата:
Сообщение: Re: SETOF