Re: SETOF (was: Function example returning more then 1

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: SETOF (was: Function example returning more then 1
Дата
Msg-id 20030227082228.P86039-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: SETOF (was: Function example returning more then 1  (Kolus Maximiliano <Kolus.maximiliano@bcr.com.ar>)
Список pgsql-general
On Thu, 27 Feb 2003, Kolus Maximiliano wrote:

> >     You can't return more than one return value from function, but that
> > value can be of composite type.For example :"setof text" or "setof record"
> > are such types.
>
>     Can you use functions returning "setof"s as if they were "normal"
> selects?.
>
>     I saw that setof takes a type or table as an argument. What if what
> i want to return is not in a table schema, can i do something like "setof
> (blah inet, blah2 varchar(256))"?

You might want to read the Set Returning Functions document on techdocs:
http://techdocs.postgresql.org/guides/SetReturningFunctions

The best answer is to define a row type for it with CREATE TYPE, but you
can also return setof record and rely on the user putting the type
information in the select.


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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: 7.4?
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: index usage (and foreign keys/triggers)