Re: Recursive call indicator/counter

From: elein <elein(at)sbcglobal(dot)net>
To: Hadley Willan <hadley(dot)willan(at)deeper(dot)co(dot)nz>, Postgresql General <pgsql-general(at)postgresql(dot)org>
Cc: elein(at)norcov(dot)com
Subject: Re: Recursive call indicator/counter
Date: 2002-11-09 22:19:36
Message-ID: 200211092119.gA9LJMoP581018@pimout2-ext.prodigy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


You can also write the function in plpython. Plpython
has the concept of a statement duration data dictionary.
Since the calls are recursive they should all be in the same
SQL statement duration. This is also a very handy way
to write running sums, etc.

elein(at)norcov(dot)com

On Thursday 07 November 2002 18:38, Hadley Willan wrote:
> Gudday' all.
>
> In plpgsql, I've written a function that can call itself if
> necessary and thus recurse down to the bottom of a tree, operate on
> bottom node, then as it comes out, operate on each node, until
> eventually it gets to the top again.
>
> However, is there any system variable that I can check to see if this
> function has just been called for the first time or if this is the nTH
> call from itself?
>
> Thanks.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-11-10 05:13:51 Re: Win2K Questions
Previous Message elein 2002-11-09 21:16:32 Re: Column based on pg-general