Re: PL/PGSQL - Mailing list pgsql-sql

From Alex Pilosov
Subject Re: PL/PGSQL
Date
Msg-id Pine.BSO.4.10.10106121313360.9902-100000@spider.pilosoft.com
Whole thread Raw
In response to PL/PGSQL  (Andrzej Roszkowski <thomas@polcard.com.pl>)
List pgsql-sql
You _can_ return a tuple by doing this:
create table foo(x int, y text);

create function bar() returns foo as '
...
';

The only thing is, you can't do much with such a function (currently), you
can only call it from a different function, and then break the result up:

foo v=bar();
do_something(v.x);
do_something(v.y);

-alex

On Tue, 5 Jun 2001, Andrzej Roszkowski wrote:

> Hi!
> I can't find any info about possible data types that can be returned from
> procedure. I want to return tuple. When I use OPAQUE as a return type I
> get error message that OPAQUE can be only returned from trigger. It is
> possible to do this without triggers?
> 
> ------------------------------------------------------------------------
> Code reviews are like sex, just anyone can do it, but skill and training
> can make you a lot better at it." - LJ 
> Thomas
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
> 
> 



pgsql-sql by date:

Previous
From: Ondrej Palkovsky
Date:
Subject: Do I have to lock table in this case?
Next
From: Stephan Szabo
Date:
Subject: Re: Foreign key to base table with rows in inherited tables