Hi,

I understood how I am going to create a table to replication. I have posted my
script
hoping that it will help to other newbies like me.

My quaestion is now that what happens when I need to do like;
creating index
create sequences
create functions
create views
alter table
etc.

If I do these commands through running 'EXECUTE SCRIPT' with slonik, will it be
replicated
on slaves?

--------------------------------------------
#!/bin/sh

/opt/EnterpriseDB/8.1.4.17/dbserver/bin/slonik <<_EOF_
        #--
        # define the namespace the replication system uses in our example it is
        # slony_example
        #--
        cluster name = $CLUSTERNAME;

        node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MASTERHOST
port=$MASTERDBPORT user=$REPLICATIONUSER';
        node 2 admin conninfo = 'dbname=$SLAVEDBNAME1 host=$SLAVEHOST1
port=$SLAVEDBPORT1 user=$REPLICATIONUSER';
        node 3 admin conninfo = 'dbname=$SLAVEDBNAME2 host=$SLAVEHOST2
port=$SLAVEDBPORT2 user=$REPLICATIONUSER';

        ##--run the scripts for creating the tables
        #EXECUTE SCRIPT (SET ID = 2,FILENAME =
'/opt/EnterpriseDB/8.1.4.17/dbserver/bin/add_table.sql',EVENT NODE = 1);
        #EXECUTE SCRIPT (SET ID = 2,FILENAME =
'/opt/EnterpriseDB/8.1.4.17/dbserver/bin/index_add.sql',EVENT NODE = 1);

        ##--create a temp set for new created tables to be merged
        #CREATE SET (id=9999, origin=1, comment='temp set tables id 9999');

        ##--add created tables to new created temp set to be merged, id= fro
table should be the next-id from origin-set
        #SET ADD TABLE (set id=9999, origin=1, id=70, fully qualified name =
'public.gurkan',             comment='gurkan table');
        #SET ADD TABLE (set id=9999, origin=1, id=71, fully qualified name =
'public.ozfidan',            comment='ozfidan table');

        ##--create union set to be merged with origin-set and temp-set
        #CREATE SET (id=1, origin=1, comment='MERGED SET TABLES ID 2');

        ##--!!!run subscribe_merge on slave/s(operation will refuse to be run if
the two sets do not have exactly the same set of subscribers)
        ##--merge these to sets (temp-set and origin-set)
        ##--
        ##--ID=ival     (Unique ID of the set to contain the union of the two
separate sets)
        ##--ADD ID=ival (Unique ID of the set whose objects should be 
transferred)
        ##--ORIGIN=ival (Current origin node for both sets)
        ##--
        MERGE SET ( ID = 1, ADD ID = 9999, ORIGIN = 1 );
        MERGE SET ( ID = 1, ADD ID = 3, ORIGIN = 1 );


        #DROP SET ( ID = 1, ORIGIN = 1 );

_EOF_
--------------------------------------------

-------------------------------------------------
This mail sent through IMP: www.resolution.com
_______________________________________________
Slony1-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/slony1-general

Reply via email to