plperl function fails to "fire" Slony trigger

From: Sven Willenberger <sven(at)dmv(dot)com>
To: postgres-general <pgsql-general(at)postgresql(dot)org>
Subject: plperl function fails to "fire" Slony trigger
Date: 2005-04-22 15:56:34
Message-ID: 1114185394.26618.20.camel@lanshark.dmv.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2005-04-22 16:18:14 Migrating MySQL app to postgres?
Previous Message Richard_D_Levine 2005-04-22 15:42:40 Re: UltraSPARC versus AMD