Re: [GENERAL] Small patch for PL/Perl Misbehavior with

Поиск
Список
Период
Сортировка
От John Worsley
Тема Re: [GENERAL] Small patch for PL/Perl Misbehavior with
Дата
Msg-id Pine.LNX.4.21.0210041940300.9959-100000@baby.audiophonic.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Small patch for PL/Perl Misbehavior with Runtime Error Reporting  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [GENERAL] Small patch for PL/Perl Misbehavior with Runtime Error Reporting  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, 3 Oct 2002, Tom Lane wrote:
>That seems a little weird.  Does Perl really expect people to do that
>(ie, is it a documented part of some API)?  I wonder whether there is
>some other action that we're supposed to take instead, but are
>missing...

Not that I know of: clearing out the $@ variable manually was just my way
of getting around the problem in practice. I think the underlying issue
may be tied to the fact that it's running a function generated within a
Safe Module, but I'm not enough of a Perl Guru to say anything more
decisive than that.

>If this is what we'd have to do, I think a better way would be
>
>    perlerrmsg = pstrdup(SvPV(ERRSV, PL_na));
>    sv_setpv(perl_get_sv("@",FALSE),"");
>    elog(ERROR, "plperl: error from function: %s", perlerrmsg);
>Splitting the ERROR into a NOTICE with the useful info and an ERROR
>without any isn't real good, because the NOTICE could get dropped on the
>floor (either because of min_message_level or a client that just plain
>loses notices).

Yeah, that's a cleaner solution. I take it anything pstrdup'd by
PostgreSQL gets freed automatically by the backend? (I wasn't familiar
enough with the backend to know how to ask for memory confident in the
understanding that it would at some point be freed. ;)

Jw.
-- 
John Worsley - lx@openvein.com
http://www.openvein.com/



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

Предыдущее
От: "Curtis Faith"
Дата:
Сообщение: Re: Potential Large Performance Gain in WAL synching
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Small patch for PL/Perl Misbehavior with Runtime Error Reporting