Josh Harrison joshques at gmail.com
Thu Dec 20 06:33:49 PST 2007
Hi
I already have a set replicating properly   . This is the  script I used for
initializing the first cluster
        cluster name =3Dslony_example;
        node 1 admin conninfo =3D 'dbname=3D$MASTERDBNAME host=3D$MASTERHOST
user=3D$REPLICATIONUSER';
        node 2 admin conninfo =3D 'dbname=3D$SLAVEDBNAME host=3D$SLAVEHOST
user=3D$REPLICATIONUSER';
        init cluster ( id=3D1, comment =3D 'Master Node');
        create set (id=3D1, origin=3D1, comment=3D'All rmrs tables');
        set add table (set id=3D1, origin=3D1, id=3D2, fully qualified name=
 =3D '
public.a_method', comment=3D'a_method table');
         .....
        store node (id=3D2, comment =3D 'Slave node');
        store path (server =3D 1, client =3D 2, conninfo=3D'dbname=3D$MASTE=
RDBNAME
host=3D$MASTERHOST user=3D$REPLICATIONUSER');
        store path (server =3D 2, client =3D 1, conninfo=3D'dbname=3D$SLAVE=
DBNAME
host=3D$SLAVEHOST user=3D$REPLICATIONUSER');

   Now I want to add 2 tables dummy1 and dummy2 to the cluster. I had
created the tables using 'execute script' and the tables now exist in the
master and slave node. Now to add these 2 tables to the replication set I
try to run this script
        cluster name =3Dslony_example;
        node 1 admin conninfo =3D 'dbname=3D$MASTERDBNAME host=3D$MASTERHOST
user=3D$REPLICATIONUSER';
        node 2 admin conninfo =3D 'dbname=3D$SLAVEDBNAME host=3D$SLAVEHOST
user=3D$REPLICATIONUSER';
        create set (id=3D45, origin=3D1, comment=3D'All rmrs tables');
        set add table (set id=3D45, origin=3D1, id=3D46, fully qualified na=
me =3D '
public.dummy1', comment=3D'dummy1 table');
       set add table (set id=3D45, origin=3D1, id=3D47, fully qualified nam=
e =3D '
public.dummy2', comment=3D'dummy2 table');
       subscribe set(id=3D45, provider=3D1,receiver=3D2,forward=3Dno);
       merge set(id=3D1,add id=3D45, origin=3D1);

But I get this error. What am I doing wrong here?

<stdin>:36: PGRES_FATAL_ERROR select "_slony_example".storeSet(45, 'All
example tables');  - ERROR:  duplicate key violates unique constraint
"sl_set-pkey"
CONTEXT:  PL/pgSQL function "storeset" line 13 at SQL statement

Thanks
josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.slony.info/pipermail/slony1-general/attachments/20071220/=
e4b95e15/attachment.htm


More information about the Slony1-general mailing list