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

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

From: David Fetter <david(at)fetter(dot)org>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
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 ENDblocks
Date: 2009-09-21 18:17:13
Message-ID: 20090921181713.GL31599@fetter.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Mon, Sep 21, 2009 at 01:06:17PM -0400, Alvaro Herrera wrote:
> 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.

This is not quite what I meant.  Let's say we have two or more different
PL/Perl functions executed over the course of a backend.  Which one's
END block gets executed last?  Do we need to warn people about this?
Generate a WARNING, even?

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

pgsql-bugs by date

Next:From: Robert HaasDate: 2009-09-21 18:28:11
Subject: Re: BUG #5066: plperl issues with perl_destruct() and END blocks
Previous:From: Robert HaasDate: 2009-09-21 17:22:29
Subject: Re: BUG #5053: domain constraints still leak

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