Re: example of really weird caching (or whatever) problem

From: "Brandon Metcalf" <bmetcalf(at)nortel(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: example of really weird caching (or whatever) problem
Date: 2008-11-20 18:11:35
Message-ID: Pine.LNX.4.58L.0811201209510.13425@cash.us.nortel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

d == dev(at)archonet(dot)com writes:

d> Brandon Metcalf wrote:
d> >
d> > OK. I understand the Perl part of what is going on. What I don't
d> > understand is why $table in do_delete() hangs around. It seems this
d> > is more a characteristic of how triggers work in pgsql. At any rate,
d> > I appreciate the input since it provides me with a fix.

d> Because it will persist until either:
d> 1. "sub do_delete" expires
d> 2. the whole perl interpreter expires (which then implies #1)

d> Your trigger function will be "compiled"* just before it is first called
d> and will then exist until #2 above happens (when you disconnect). Since
d> your trigger function exists, that implies do_delete continues to exist
d> which means its version of $table continues to exist. It really is
d> exactly like that example script I attached, where the "exit" equals
d> database end-of-session.

OK, that makes sense.

d> * ok, perl is technically interpreted, except of course it isn't really,
d> and I don't know what a better term than compiled would be.

No, you're right. It is compiled before being executed, but not in
the sense that C code is compiled.

--
Brandon

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-11-20 18:40:54 Re: join with redundant results VS simpler join plus multiple selects
Previous Message Richard Huxton 2008-11-20 18:03:15 Re: example of really weird caching (or whatever) problem