Re: Return type for procedure

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема Re: Return type for procedure
Дата
Msg-id c2d9e70e0608152028ldc8693crcb10ed081d23ac15@mail.gmail.com
обсуждение исходный текст
Ответ на Return type for procedure  ("ben sewell" <mosherben@gmail.com>)
Ответы Re: Return type for procedure  ("ben sewell" <mosherben@gmail.com>)
Список pgsql-novice
>
> What I was wondering was if it was possible for me to return different user
> defined types. To try to illustrate what I mean, here's some example code
> which I think is allowed:
>

yes.

just create your functions as:

CREATE FUNCTION test() RETURNS record as $$
$$ language 'your-language';

then execute the function as

select * from test() as (field1 type1, field2 type2...);

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

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

Предыдущее
От: Andreas
Дата:
Сообщение: Re: Optimal Postgres Development Process, Software
Следующее
От: "Jasbinder Bali"
Дата:
Сообщение: DB insert Error