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

From: Richard Huxton <dev(at)archonet(dot)com>
To: Brandon Metcalf <bmetcalf(at)nortel(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: example of really weird caching (or whatever) problem
Date: 2008-11-20 18:03:15
Message-ID: 4925A663.6060404@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brandon Metcalf 2008-11-20 18:11:35 Re: example of really weird caching (or whatever) problem
Previous Message Brandon Metcalf 2008-11-20 17:54:48 Re: example of really weird caching (or whatever) problem