Christopher Browne cbbrowne at ca.afilias.info
Fri Jul 31 10:19:00 PDT 2009
Ran into the following...

2009-07-31 13:07:50 EDT DEBUG2 remoteWorkerThread_1: prepare to copy table "public"."table3"
2009-07-31 13:07:50 EDT DEBUG2 remoteWorkerThread_1: prepare to copy table "public"."table5"
2009-07-31 13:07:50 EDT DEBUG2 remoteWorkerThread_1: all tables for set 1 found on subscriber
2009-07-31 13:07:50 EDT DEBUG2 remoteWorkerThread_1: copy table "public"."table1"
2009-07-31 13:07:50 EDT ERROR  remoteWorkerThread_1: "select "_slony_regress1".setAddTable_int(1, 1, '"public"."table1"', 'table1_pkey', 'accounts table'); " PGRES_FATAL_ERROR ERROR:  column "reltriggers" does not exist
LINE 1: update "pg_catalog".pg_class set reltriggers = reltriggers -...
                                                       ^
QUERY:  update "pg_catalog".pg_class set reltriggers = reltriggers -  $1  where oid =  $2
CONTEXT:  PL/pgSQL function "altertableforreplication" line 116 at SQL statement
SQL statement "SELECT  "_slony_regress1".alterTableForReplication( $1 )"
PL/pgSQL function "setaddtable_int" line 109 at PERFORM
2009-07-31 13:07:50 EDT WARN   remoteWorkerThread_1: data copy for set 1 failed - sleep 15 seconds
2009-07-31 13:07:58 EDT DEBUG2 syncThread: new sl_action_seq 1 - SYNC 3


This results from the following query, in alterTableForReplication():

		-- ----
		-- Disable all existing triggers
		-- ----
		update "pg_catalog".pg_trigger
				set tgrelid = v_tab_row.indexrelid
				where tgrelid = v_tab_row.tab_reloid
				and not exists (
						select true from @NAMESPACE at .sl_table TAB,
								@NAMESPACE at .sl_trigger TRIG
								where TAB.tab_reloid = tgrelid
								and TAB.tab_id = TRIG.trig_tabid
								and TRIG.trig_tgname = tgname
					);
		get diagnostics v_n = row_count;
		if v_n > 0 then
			update "pg_catalog".pg_class
					set reltriggers = reltriggers - v_n
					where oid = v_tab_row.tab_reloid;
		end if;

pg_class no longer has the "reltriggers" column...

The same issue affects alterTableRestore().

I see two approaches:

  1.  Create slony1_funcs.v84.sql which removes this update

  2.  Have the functions themselves look for the existence of the
     "reltriggers" column, and omit the update if the column isn't 
     found.

The latter is a bit more complex change, within slony1_funcs.sql, but
doesn't force us into adding a lot more logic to detect 8.4...

Any thoughts, Jan?
-- 
(reverse (concatenate 'string "ofni.sailifa.ac" "@" "enworbbc"))
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


More information about the Slony1-hackers mailing list