Re: Return type for procedure

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "ben sewell" <mosherben(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Return type for procedure
Date: 2006-08-16 03:28:53
Message-ID: c2d9e70e0608152028ldc8693crcb10ed081d23ac15@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jasbinder Bali 2006-08-16 03:55:58 DB insert Error
Previous Message Andreas 2006-08-16 00:58:49 Re: Optimal Postgres Development Process, Software