Re: example of really weird caching (or whatever) problem - Mailing list pgsql-general

From Richard Huxton
Subject Re: example of really weird caching (or whatever) problem
Date
Msg-id 4925A663.6060404@archonet.com
Whole thread Raw
In response to Re: example of really weird caching (or whatever) problem  ("Brandon Metcalf" <bmetcalf@nortel.com>)
Responses Re: example of really weird caching (or whatever) problem  ("Brandon Metcalf" <bmetcalf@nortel.com>)
List pgsql-general
Brandon Metcalf wrote:
>
> OK.  I understand the Perl part of what is going on.  What I don't
> understand is why $table in do_delete() hangs around.  It seems this
> is more a characteristic of how triggers work in pgsql.  At any rate,
> I appreciate the input since it provides me with a fix.

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

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


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

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: "Brandon Metcalf"
Date:
Subject: Re: example of really weird caching (or whatever) problem
Next
From: "Brandon Metcalf"
Date:
Subject: Re: example of really weird caching (or whatever) problem