Skip site navigation (1) Skip section navigation (2)

Re: functions returning records

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Alex Pilosov <alex(at)pilosoft(dot)com>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, Hannu Krosing <hannu(at)tm(dot)ee>, pgsql-hackers(at)PostgreSQL(dot)org
Subject: Re: functions returning records
Date: 2001-06-28 11:50:26
Message-ID: 200106281150.f5SBoQk21228@jupiter.us.greatbridge.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Alex Pilosov wrote:
> On Wed, 27 Jun 2001, Jan Wieck wrote:
>
> > Alex Pilosov wrote:
> > > On Thu, 28 Jun 2001, Hannu Krosing wrote:
> > > >
> > > > How hard would it be to turn this around and implement RETURN AND
> > > > CONTINUE
> > > > for at least PL/PGSQL, and possibly C/Perl/Python ... ?
> > > Cannot talk about plpgsql, but for c this would be probably implemented
> > > with setjmp and with perl with goto. Probably not very complex.
> >
> >     Don't  think  so.  When  the function returns, the call stack
> >     get's destroyed. Jumping back to there - er - the  core  dump
> >     is not even useful any more. Or did I miss something?
>
> Well, it shouldn't return, but instead save the location and longjmp to
> SPI_RESUME_jmp location. On a next call, instead of a function call, it
> should longjmp back to saved location. I have to admit its more complex
> than I originally thought, but probably doable.

    OK, let's screw it up some more:

        SELECT F.a, B.b FROM foo() F, bar() B
            WHERE F.a = B.a;

    This should normally result in a merge join, so you might get
    away with longjmp's. But you get the idea.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck(at)Yahoo(dot)com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


In response to

Responses

pgsql-hackers by date

Next:From: Oleg BartunovDate: 2001-06-28 12:22:03
Subject: Patch for multi-key GiST (current CVS)
Previous:From: Karel ZakDate: 2001-06-28 07:41:11
Subject: Re: functions returning records

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group