Re: Error handling in plperl and pltcl

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Jan Wieck <JanWieck(at)Yahoo(dot)com>, Thomas Hallgren <thhal(at)mailblocks(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Error handling in plperl and pltcl
Date: 2004-11-30 16:45:56
Message-ID: 41ACA3C4.8030802@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>
>In the case of Perl I suspect it is reasonably possible to determine
>whether there is an "eval" surrounding the call or not, although we
>might have to get more friendly with Perl's internal data structures
>than a purist would like.
>
>

Not really very hard. (caller(0))[3] should have the value "(eval)" if
you are in an eval. There might also be some ways of getting this via
the perlguts API although I'm not aware of it. Of course, if you're in a
subroutine which is in turn called from an eval things get trickier, so
we might have to walk the stack frames a bit.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Wong 2004-11-30 16:55:01 Re: 8.0beta5 results w/ dbt2
Previous Message Mark Wong 2004-11-30 16:44:41 Re: 8.0beta5 results w/ dbt2