Aaron Thul aaron
Fri May 13 21:01:03 PDT 2005
I no sooner have the same problem and it seems people are talking about it.  How 
serendipitous for me. 

I have the exact same scenario and I too have the problem of the trigger. 
"ERROR:  could not find trigger 40749"  Matt, I am going to give your patch a 
try give it some extra testing.  I will let you know if it solves the problem 
for my situation.  If it does then what you did might be pretty sane.  

Aaron Thul


mrich at tigris.org wrote:
>
>> ... so I've been playing with alterTableForReplication/alterTableRestore
>> () and it does seem to bear out that when removing the code that
>> disables triggers, the scripts seem to execute fine on the slave.  There
>> seem to be a couple of methods to disable triggers, which is the
>> "correct" method I don't know:
>
>Since the dependencies table (pg_depend) is the only place that I could
>actually find any reference to the relations in questions, I decided to
>muck around with it a bit.  Following the existing methodology, I
>rewrote all the constraint/trigger dependencies for subscribed tables to
>also point to the pk index.  This appears to actually avoid the "missing
>trigger" problem, and the scripts seem to execute correctly.  I don't
>exactly know how sane this is, and I didn't actually test it that much,
>but there it is.  I thought I would throw it out there nonetheless.
>
>Matt
>
>-- 
>Matthew Rich <mrich at tigris.org>
>
>--- slony1_funcs.sql.orig	2005-05-10 23:20:32.000000000 -0700
>+++ slony1_funcs.sql	2005-05-11 18:49:07.000000000 -0700
>@@ -3264,7 +3264,8 @@
> 					set reltriggers = reltriggers - v_n
> 					where oid = v_tab_row.tab_reloid;
> 		end if;
>-
>+		update "pg_catalog".pg_depend set refobjid = v_tab_row.indexrelid where refobjid = v_tab_row.tab_reloid and objid in (select oid from "pg_catalog".pg_trigger where tgrelid = v_tab_row.indexrelid);
>+		update "pg_catalog".pg_depend set refobjid = v_tab_row.indexrelid where refobjid = v_tab_row.tab_reloid and objid in (select oid from "pg_catalog".pg_constraint where conrelid = v_tab_row.indexrelid);
> 		-- ----
> 		-- Disable all existing rules
> 		-- ----
>@@ -3367,6 +3368,9 @@
> 		-- ----
> 		execute ''drop trigger "_ at CLUSTERNAME@_denyaccess_'' || 
> 				p_tab_id || ''" on '' || v_tab_fqname;
>+
>+		update "pg_catalog".pg_depend set refobjid = v_tab_row.tab_reloid where refobjid = v_tab_row.indexrelid and objid in (select oid from "pg_catalog".pg_trigger where tgrelid = v_tab_row.indexrelid);
>+		update "pg_catalog".pg_depend set refobjid = v_tab_row.tab_reloid where refobjid = v_tab_row.indexrelid and objid in (select oid from "pg_catalog".pg_constraint where conrelid = v_tab_row.indexrelid);
> 				
> 		-- ----
> 		-- Restore all original triggers_______________________________________________
>Slony1-general mailing list
>Slony1-general at gborg.postgresql.org
>http://gborg.postgresql.org/mailman/listinfo/slony1-general
>

_______________________________________________________
Sent through e-mol. E-mail, Anywhere, Anytime. http://www.e-mol.com





More information about the Slony1-general mailing list