Conditional Replication support by Achilleus Mantzios ------------------- 1) Compile pending.c with the CONDITIONAL_REPLICATION flag. 2) After running MirrorSetup.sql run the SQL commands in MirrorSetupAddOn.sql The replication system distinguishes between 3 types of tables. In all cases the recordchange trigger must be added to the table(See AddTriger.sql) 1) Tables where all rows are sent to all slaves. To setup tables of this type add the an entry for the table into the dbmirror_explicitreptables with the tablename and a sitekeyname set to NULL. 2) Tables where rows are conditionally replicated to slaves based on the value of one of the columns. For example if you have a table named "branch" that contains an "id" column that you wish to perform filtering on you would add the following to dbmirror_explicitreptables. INSERT INTO dbmirror_explicitreptables (tblname,sitekeyname) VALUES ('public.branch','id'); This means that rows in the "branch" table will only be filtered sent to slaves whoes dbmirror_MirrorHost.MirrorHostId value is equal to the "id" value in that row of the branch table. 3) Tables where rows are implicitly replicated based on those rows being referencd through a foreign key by another table that is being conditionally replicated(Type 2). For example consider a Manager table where the Branch table contains a ManagerId column that references the id column in the manager table. Only the rows in the Manager table that are referenced by the branches being sent to a particular slave will be sent to the slave. To setup an implicit table just add the trigger. Nothing needs to be added to the explicitreptables.