d == dev@xxxxxxxxxxxx writes: d> Brandon Metcalf wrote: d> > Yep, it seems that's the problem. If I pass in $table and use a d> > lexical variable defined inside do_delete(), the problem goes away. d> > So, this is where my understanding of how triggers work lacks. For a d> > given session, each execution of a trigger isn't completely d> > independent? d> Nothing to do with triggers - it's all to do with your Perl code. I respectfully disagree because if I don't execute a DELETE on foo2 as shown in my original email, the problem doesn't occur. Somewhere in the trigger execution it's remembering the first table on which the trigger fired. So, the information about foo2 is coming from somewhere and it's in the Perl code. In other words, I performing two different DELETEs which cause two different invocations of the same trigger. d> #!/usr/bin/perl d> sub foo { d> my $x = shift; d> print "foo x = $x\n"; d> bar(); d> return; d> sub bar { d> print "bar x = $x\n"; d> } d> } d> foo(1); d> foo(2); d> exit; d> $ ./perl_example.pl d> foo x = 1 d> bar x = 1 d> foo x = 2 d> bar x = 1 d> If you use warnings it'll tell you about it too with this example. -- Brandon -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general