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

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 (view raw or flat)
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

pgsql-hackers by date

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

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