Re: Error handling in plperl and pltcl

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Error handling in plperl and pltcl
Дата
Msg-id 41ACA3C4.8030802@dunslane.net
обсуждение исходный текст
Ответ на Re: Error handling in plperl and pltcl  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mark Wong
Дата:
Сообщение: Re: 8.0beta5 results w/ dbt2
Следующее
От: Mark Wong
Дата:
Сообщение: Re: 8.0beta5 results w/ dbt2