Re: functions returning records - Mailing list pgsql-hackers

From Alex Pilosov
Subject Re: functions returning records
Date
Msg-id Pine.BSO.4.10.10106281320370.598-100000@spider.pilosoft.com
Whole thread Raw
In response to Re: functions returning records  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
On Thu, 28 Jun 2001, Jan Wieck wrote:

> 
>     On  a  third  thought, you don't get anywhere with longjmp's.
>     You have a  call  stack,  do  a  setjmp()  saving  the  stack
>     pointer. Then you call the function, do another setjmp() here
>     and do the longjmp() to #1. This  restores  the  saved  stack
>     pointer,  so at the very first time you do any other function
>     call (lib calls included), you corrupt the stack frame at the
>     current  stack  pointer  position.  If you later jump back to
>     setjmp() #2 location, you'll not be able to return.
> 
>     You can only drop stack frames safely,  you  can't  add  them
>     back, they aren't saved.
True. I withdraw the idea. 

See this for a s[l]ick implementation of coroutines in C:

http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

(essentially a replacement for set of gotos)

Tis ugly, but it should work (tm).




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Patch for multi-key GiST (current CVS)
Next
From: Mike Cianflone
Date:
Subject: Order of triggers