Return type for procedure - Mailing list pgsql-novice

From ben sewell
Subject Return type for procedure
Date
Msg-id bf6c74d80608150152v2ddf70dbw9bf4423a3fbe7622@mail.gmail.com
Whole thread Raw
Responses Re: Return type for procedure  ("Jaime Casanova" <systemguards@gmail.com>)
List pgsql-novice
Hi,
I'm writing a procedure, where I'm trying to save writing other procedures by combining all of them in one procedure. All procdures take the same input parameters so I would imagine this is possible.
 
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:
 
if id="1" then
  processing code
  return usertype3;
elseif id="2" then
  processing code 
  return usertype3;
elseif id="3" then
  processing code
  return usertype3;
endif;
 
Is this possible?
 
Cheers,
Ben

pgsql-novice by date:

Previous
From: Sean Davis
Date:
Subject: Re: can someone tell me what's wrong with this procedure?
Next
From: "Roger Rasmussen"
Date:
Subject: Optimal Postgres Development Process, Software