<div dir="ltr"><div class="gmail_quote">On Sat, Oct 9, 2010 at 11:11 PM, raghavendra t <span dir="ltr">&lt;<a href="mailto:raagavendra.rao@gmail.com">raagavendra.rao@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<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><div></div><div class="h5">
<div class="gmail_quote">On Sun, Oct 10, 2010 at 3:19 AM, Steve Singer <span dir="ltr">&lt;<a href="mailto:ssinger_pg@sympatico.ca" target="_blank">ssinger_pg@sympatico.ca</a>&gt;</span> wrote:<br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div>raghavendra t wrote:<br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); 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 &quot;/usr/local/src/slony1-2.0.4/tools/altperl/slon_tools.conf-sample&quot; 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 &quot;slon_tools.conf-sample&quot;.<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><br><br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;" class="gmail_quote"><br>My Testing<br>========<br>1. Created a tables file &quot;tab.txt&quot; with set of replicating primary key tables.<br>


<br>2. Edited the &quot;slon_tools.conf-sample&quot; and trying to send the &quot;tab.txt&quot; file. Below is the &quot;slon_tools.conf-sample&quot; file I am trying to use<br><br>$CLUSTER_NAME = &#39;firstreplic&#39;;<br>


$LOGDIR = &#39;/var/log/slony&#39;;<br>$MASTERNODE = 1;<br>$DEBUGLEVEL = 2;<br>*$TABLEFILE = &#39;/usr/local/pgsql/bin/tab.txt&#39;;*<br><br>&amp;add_node(node =&gt; 1,host =&gt; &#39;localhost&#39;,dbname =&gt; &#39;master&#39;,port =&gt; 5455,user =&gt; &#39;postgres&#39;,password =&gt; &#39;&#39;);<br>


&amp;add_node(node =&gt; 2,host =&gt; &#39;localhost&#39;,dbname =&gt; &#39;slave&#39;,port =&gt; 5456,user =&gt; &#39;postgres&#39;,password =&gt; &#39;&#39;);<br></blockquote><br></div>open(INFILE,&quot;&lt;$TABLEFILE&quot;);<br>


my $tables=&#39;&#39;;<br>while(&lt;INFILE&gt;) {<br><br>{<br>  $line = chomp $_;<br>  $tables+=$line;<br>}<br><br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div><br>$SLONY_SETS =<br>{<br>   &quot;set1&quot; =&gt;<br>   {<br>       &quot;set_id&quot; =&gt; 1,<br>       &quot;table_id&quot; =&gt; 1,<br>       &quot;pkeyedtables&quot; =&gt;<br></div>                      * [$TABLEFILE,],*<br>


</blockquote>pkeytables=&gt;$tables  #(replace the above line with this one)<br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div>   }<br>};<br><br>Kindly assist me, how to achieve this task.<br><br clear="all"></div></blockquote></blockquote></div></div></div></blockquote><div><br>This is a working code from a setup that I did recently:<br><br>

&quot;pkeyedtables&quot; =&gt; [ eval &#39;open( fh, &quot;tables&quot;); my $ret; while(&lt;fh&gt;){chomp; $ret .= &quot;$set_name.$_\|&quot;}; close fh;return split /\|/,$ret;&#39;], <br><br>You will need to adapt it to your needs.<br>

<br>Regards,<br></div></div>-- <br>gurjeet.singh<br>@ EnterpriseDB - The Enterprise Postgres Company<br><a href="http://www.EnterpriseDB.com">http://www.EnterpriseDB.com</a><br><br>singh.gurjeet@{ gmail | yahoo }.com<br>
Twitter/Skype: singh_gurjeet<br>
<br>Mail sent from my BlackLaptop device<br>
</div>