plperl function fails to "fire" Slony trigger - Mailing list pgsql-general

From Sven Willenberger
Subject plperl function fails to "fire" Slony trigger
Date
Msg-id 1114185394.26618.20.camel@lanshark.dmv.com
Whole thread Raw
Responses Re: plperl function fails to "fire" Slony trigger  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
We have a replication set up between 2 servers using Slony; both are
runnind PostgreSQL 8.0.1. The issue is that when updates/inserts are
made to a replicated table, the replication does not occur; apparently
this is due to spi_exec somehow not allowing/causing the slony trigger
function to fire. The following 2 queries achieve the same result (one
in SQL and the other in plperl) however only the one in SQL ends up
being replicated:

create or replace function test_insert(int) returns text as $func$
my $query = "insert into inter_rootdecks(id,npanxx,carrier,inter) select
$_[0],npanxx,carrier,inter from inter_rootdecks where id = 20;";
$rv = spi_exec_query($query);
return "done";
$func$ LANGUAGE plperl;

create function test_insert(int) RETURNS text as $func$
INSERT INTO inter_rootdecks (id,npanxx,carrier,inter) select
$1,npanxx,carrier,inter from inter_rootdecks where id = 20;
SELECT 'done'::text;
$func$ LANGUAGE SQL;


Both are very basic insert statements, the difference being that the one
written in SQL ends up being replicated, the one written in plperl
utilizing spi_exec_query does not. In both cases the insert succesfully
completes on the source server.

Is there anything else that needs to happen in a plperl function such
that applicable triggers fire?

Sven


pgsql-general by date:

Previous
From: Richard_D_Levine@raytheon.com
Date:
Subject: Re: UltraSPARC versus AMD
Next
From: Bruno Wolff III
Date:
Subject: Re: postgres user work with any password!