Re: (Never?) Kill Postmaster?

From: Christian Schröder <cs(at)deriva(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: (Never?) Kill Postmaster?
Date: 2007-11-09 11:00:46
Message-ID: 47343DDE.5080908@deriva.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message rihad 2007-11-09 11:17:53 Re: any way for ORDER BY x to imply NULLS FIRST in 8.3?
Previous Message Pavel Stehule 2007-11-09 10:32:46 Re: configure using libxml