From: | Alex Pilosov <alex(at)pilosoft(dot)com> |
---|---|
To: | Andrzej Roszkowski <thomas(at)polcard(dot)com(dot)pl> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: PL/PGSQL |
Date: | 2001-06-12 17:15:27 |
Message-ID: | Pine.BSO.4.10.10106121313360.9902-100000@spider.pilosoft.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2001-06-12 17:28:44 | Re: cascading delete - recursivity |
Previous Message | Mathijs Brands | 2001-06-12 17:03:42 | Re: Cluster and primary key |