Re: (Never?) Kill Postmaster? - Mailing list pgsql-general

From Christian Schröder
Subject Re: (Never?) Kill Postmaster?
Date
Msg-id 47343DDE.5080908@deriva.de
Whole thread Raw
In response to Re: (Never?) Kill Postmaster?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> control has already returned from the kernel.  What I think is that the
> perl stuff your session has done has included some action that changed
> the condition of the backend process ... exactly what, I have no idea.
> Can you show us the plperl functions that were used in these sessions?
>
Considering the skill level of the users I don't think that they
explicitly used any perl function. So the only remaining perl stuff are
the triggers that I mentioned earlier. There are two triggers in the
database to which the users were connected (see
http://archives.postgresql.org/pgsql-general/2007-11/msg00245.php).
There are three more triggers in other databases which might have an impact:

=============================
        if ($_TD->{argc} != 1) {
                elog(ERROR, 'do_fast_export_log() needs the table\'s
primary key as sole argument, multiple keys are not yet supported.');
        }

        my $table = $_TD->{table_name};
        my $id = $_TD->{old}{$_TD->{args}[0]};

        while (my ($col, $value) = each %{$_TD->{old}}) {
                my $oldVal = $_TD->{old}{$col};
                my $newVal = $_TD->{new}{$col};

                $oldVal =~ s/'/''/g;
                $oldVal =~ s/\t/\\\\t/g;
                $newVal =~ s/'/''/g;
                $newVal =~ s/\t/\\\\t/g;

                if ($oldVal ne $newVal) {
                        my $data = "$id\t$table\t$col\t$oldVal\t$newVal";
                        my $query = spi_exec_query("insert into
fast_export(data) values(E'$data')");
                }
        }

        spi_exec_query("notify fast_export");
        return;
=============================
    elog(ERROR, 'store_session_user needs the field name as argument.')
        if $_TD->{argc} < 1;

    my ($field) = @{$_TD->{args}};

    elog(ERROR, "Field '$field' does not exist in target table.\n")
        unless exists $_TD->{new}{$field};

    my $query = spi_exec_query('SELECT session_user', 1);
    $_TD->{new}{$field} = $query->{rows}[0]{session_user};
    return 'MODIFY';
=============================
    if ($_TD->{argc} > 0) {
        foreach (@{$_TD->{args}}) {
            $_TD->{new}{$_} = $_TD->{old}{$_}
                if exists $_TD->{old}{$_};
        }
        return 'MODIFY';
    }
    else {
        return;
    }
=============================

Regards,
    Christian

--
Deriva GmbH                         Tel.: +49 551 489500-42
Financial IT and Consulting         Fax:  +49 551 489500-91
Hans-Böckler-Straße 2                  http://www.deriva.de
D-37079 Göttingen

Deriva CA Certificate: http://www.deriva.de/deriva-ca.cer


pgsql-general by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: configure using libxml
Next
From: rihad
Date:
Subject: Re: any way for ORDER BY x to imply NULLS FIRST in 8.3?