Home > Archive > Slony1 PostgreSQL Replication > February 2006 > Example of adding a table to an existing set ... ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Example of adding a table to an existing set ... ?
Marc G. Fournier

2006-02-28, 8:34 pm


Looking at http://linuxfinances.info/info/addthings.html, I'm wondering if
someone has an example slonik script that would add one table to an
existing set, where one is dealing with a single slave?

Is it as simple as:

slonik <<_EOF_
CREATE SET ( ID = 999, ORIGIN = 1, COMMENT = 'Add New Table' );

SET ADD TABLE (
SET ID = 999,
ORIGIN = 1,
ID = 20,
FULLY QUALIFIED NAME = 'public.newtable',
COMMENT = 'New Table To Add'
);

SUBSCRIBE SET (
ID = 999,
PROVIDER = 1,
RECEIVER = 2,
FORWARD = YES
);

MERGE SET ( ID = 1,
ADD ID = 9999,
ORIGIN = 1 );

_EOF_

Now, I'm guessing right now, but PROVIDER/RECEIVER can "reuse" the ones
that are already defined as part of the original replication set, I don't
need to create new ones just for the temporary set, do I?

Also, is there a way in slonik of telling SET ADD TABLE to use the next
available ID, or do I have to query the sl_table for 'max(tab_id) + 1'
before I setup the script?

And, finally, I hope ... MERGE SET automatically gets rid of the TEMP SET
that I'm creating for this purpose, or do I need to remove that after its
MERGEd?

Thanks ...
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com