Andrew Hammond andrew.george.hammond at gmail.com
Tue Apr 10 14:36:24 PDT 2007
On 4/10/07, Forum <frum at ar-sd.net> wrote:
>
> Hi again,
>
> I tried to create a new set, but I cannot but the table that is replicated
> between a->b into the b->c set.
> I get  ERROR:  duplicate key violates unique constraint
> "sl_table_tab_reloid_key".
>
> And as I read in :
> http://www.mail-archive.com/slony1-general@gborg.postgresql.org/msg02192.htm
> l
>
> it is not possible.
>
> Then how can I replicate the same table to more places???
>
> My scenarion again.
>
> a.t1 -> b.t1 -> c.t1
> a.t2 -> b.t2
>
> Database a is fully replicated into b(tables t1 && t2).
> Database b is partially replicated into c(tables t1).
>
>
> 1. I make the cluster.
> 2. I create the set1 for a && b and add the tables to the set.
> 3. Create the paths
> 4. subscribe b to the set.
> 5. Start the replication scripts... It works.
>
> Then...
>
> 6. Create the c database/schema etc.
> 7. Create a new set.
> 8. Create the paths & listens
> 9. Add the table t1 to the set ->>>> ERROR:  duplicate key violates unique
> constraint "sl_table_tab_reloid_key".

A table (or sequence, for that matter) can only be in one set at a
time. A set can either be subscribed to a node or not subscribed to a
node. If you wish to have different replication rules for different
objects, then you must put them in different sets.

So, create set1 for table1 and set2 for table2. Subscribe node2 to
both set1 and set2. Then subscribe node3 to only set1. This should
address your need.

Andrew

P.S. This is all with the caveat that you're only initializing a
single replication cluster in the database. I don't know what would
happen if you had multiple clusters, and I strongly doubt it's a
direction you will want to pursue.


More information about the Slony1-general mailing list