<div>Thank you Steve,</div>
<div> </div>
<div>Let me work and get back with the result.</div>
<div> </div>
<div>Regards</div>
<div>Raghav<br><br></div>
<div class="gmail_quote">On Sun, Oct 10, 2010 at 3:19 AM, Steve Singer <span dir="ltr"><<a href="mailto:ssinger_pg@sympatico.ca">ssinger_pg@sympatico.ca</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im">raghavendra t wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi All,<br><br>I am using slony with perltools.<br><br>I have taken the sample file from the "/usr/local/src/slony1-2.0.4/tools/altperl/slon_tools.conf-sample" and modified as per my requirement.<br>
<br>_Question_<br><br>In the place of Tables list/Sequenst list. Can I use any text file which contain all the tables information. If yes, how could I pass the test file to the "slon_tools.conf-sample".<br></blockquote>
<br></div>Yes, slon_tools.conf is a perl script, the slon_tools run the .conf file as a perl script and execute the code in it.<br><br>So you can just write perl code inside of the conf file to open up your file and read it into a variable.<br>
<br>I have not tested/tried to run the below code so there might be a syntax error or other problems but it should give you the general idea.
<div class="im"><br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>My Testing<br>========<br>1. Created a tables file "tab.txt" with set of replicating primary key tables.<br>
<br>2. Edited the "slon_tools.conf-sample" and trying to send the "tab.txt" file. Below is the "slon_tools.conf-sample" file I am trying to use<br><br>$CLUSTER_NAME = 'firstreplic';<br>
$LOGDIR = '/var/log/slony';<br>$MASTERNODE = 1;<br>$DEBUGLEVEL = 2;<br>*$TABLEFILE = '/usr/local/pgsql/bin/tab.txt';*<br><br>&add_node(node => 1,host => 'localhost',dbname => 'master',port => 5455,user => 'postgres',password => '');<br>
&add_node(node => 2,host => 'localhost',dbname => 'slave',port => 5456,user => 'postgres',password => '');<br></blockquote><br></div>open(INFILE,"<$TABLEFILE");<br>
my $tables='';<br>while(<INFILE>) {<br><br>{<br> $line = chomp $_;<br> $tables+=$line;<br>}<br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im"><br>$SLONY_SETS =<br>{<br> "set1" =><br> {<br> "set_id" => 1,<br> "table_id" => 1,<br> "pkeyedtables" =><br></div> * [$TABLEFILE,],*<br>
</blockquote>pkeytables=>$tables #(replace the above line with this one)<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im"> }<br>};<br><br>Kindly assist me, how to achieve this task.<br><br>Best Regards<br><br>Raghav<br><br><br><br></div>------------------------------------------------------------------------<br><br>_______________________________________________<br>
Slony1-general mailing list<br><a href="mailto:Slony1-general@lists.slony.info" target="_blank">Slony1-general@lists.slony.info</a><br><a href="http://lists.slony.info/mailman/listinfo/slony1-general" target="_blank">http://lists.slony.info/mailman/listinfo/slony1-general</a><br>
</blockquote><br></blockquote></div><br><br clear="all"><br>-- <br>Best Regards
<div><br></div>
<div>Raghav</div>
<div><br></div><br>