Brandon Metcalf wrote:
> Yep, it seems that's the problem.  If I pass in $table and use a
> lexical variable defined inside do_delete(), the problem goes away.
> So, this is where my understanding of how triggers work lacks.  For a
> given session, each execution of a trigger isn't completely
> independent?

Nothing to do with triggers - it's all to do with your Perl code.

#!/usr/bin/perl

sub foo {
    my $x = shift;
    print "foo x = $x\n";
    bar();
    return;

    sub bar {
        print "bar x = $x\n";
    }
}

foo(1);
foo(2);
exit;

$ ./perl_example.pl
foo x = 1
bar x = 1
foo x = 2
bar x = 1

If you use warnings it'll tell you about it too with this example.

-- 
  Richard Huxton
  Archonet Ltd

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to