Re: BUG #5066: plperl issues with perl_destruct() and END blocks

Поиск
Список
Период
Сортировка
От Tim Bunce
Тема Re: BUG #5066: plperl issues with perl_destruct() and END blocks
Дата
Msg-id 20090921100543.GA961@timac.local
обсуждение исходный текст
Ответ на Re: BUG #5066: plperl issues with perl_destruct() and END blocks  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: BUG #5066: plperl issues with perl_destruct() and END blocks  (David Fetter <david@fetter.org>)
Список pgsql-bugs
On Sun, Sep 20, 2009 at 10:00:01PM -0400, Alvaro Herrera wrote:
> There's a definitional problem here however.  When should we call the
> destructor?  My impression is that it should happen when the calling
> query terminates, not when the backend shuts down.  I'm sure this will
> cause other issues -- for example %_SHARED will be destroyed way too
> early.

The perlmod man page says:

        An "END" code block is executed as late as possible, that is, after
       perl has finished running the program and just before the interpreter
       is being exited, even if it is exiting as a result of a die() function.
       [...]
       Note that "END" code blocks are not executed at the end of a string
       "eval()": if any "END" code blocks are created in a string "eval()",
       they will be executed just as any other "END" code block of that pack‐
       age in LIFO order just before the interpreter is being exited.

so executing at the end of query, a transaction, or a session would be
wrong. They should execute "as late as possible", "just before the
interpreter being exited".

Tim.

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

Предыдущее
От: Annita Veneti
Дата:
Сообщение: Re: BUG #5063: MS Access crashes by quiting after linking tables with PostgreSQL
Следующее
От: "Cedric Berger"
Дата:
Сообщение: BUG #5070: Drop cascade fails on 8.4