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

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5066: plperl issues with perl_destruct() and END blocks
Date: 2009-09-21 17:06:17
Message-ID: 20090921170617.GL29793@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Fetter escribió:
> On Mon, Sep 21, 2009 at 12:06:30PM -0400, Alvaro Herrera wrote:
> > David Fetter escribió:
> >
> > > Taken literally, that would mean, "the last action before the
> > > backend exits," but at least to me, that sounds troubling for the
> > > same reasons that "end of transaction" triggers do. What happens
> > > when there are two different END blocks in a session?
> >
> > The manual is clear that both are executed.
>
> So it is, but does order matter, and if so, how would PostgreSQL know?

The fine manual saith

You may have multiple "END" blocks within a file--they will execute in
reverse order of definition; that is: last in, first out (LIFO).

But then, why would we care? We just call the destructor and Perl
ensures that the blocks are called in the right order.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2009-09-21 17:19:59 Re: BUG #5066: plperl issues with perl_destruct() and END blocks
Previous Message David Fetter 2009-09-21 16:53:27 Re: BUG #5066: plperl issues with perl_destruct() and END blocks