Re: Return type for procedure - Mailing list pgsql-novice

From Jaime Casanova
Subject Re: Return type for procedure
Date
Msg-id c2d9e70e0608152028ldc8693crcb10ed081d23ac15@mail.gmail.com
Whole thread Raw
In response to Return type for procedure  ("ben sewell" <mosherben@gmail.com>)
Responses Re: Return type for procedure  ("ben sewell" <mosherben@gmail.com>)
List 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 by date:

Previous
From: Andreas
Date:
Subject: Re: Optimal Postgres Development Process, Software
Next
From: "Jasbinder Bali"
Date:
Subject: DB insert Error