raghavendra t raagavendra.rao at gmail.com
Sat Oct 9 20:11:45 PDT 2010
Thank you Steve,

Let me work and get back with the result.

Regards
Raghav

On Sun, Oct 10, 2010 at 3:19 AM, Steve Singer <ssinger_pg at sympatico.ca>wrote:

> raghavendra t wrote:
>
>> Hi All,
>>
>> I am using slony with perltools.
>>
>> 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.
>>
>> _Question_
>>
>> 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".
>>
>
> 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.
>
> So you can just write perl code inside of the conf file to open up your
> file and read it into a variable.
>
> 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.
>
>
>
>> My Testing
>> ========
>> 1. Created a tables file "tab.txt" with set of replicating primary key
>> tables.
>>
>> 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
>>
>> $CLUSTER_NAME = 'firstreplic';
>> $LOGDIR = '/var/log/slony';
>> $MASTERNODE = 1;
>> $DEBUGLEVEL = 2;
>> *$TABLEFILE = '/usr/local/pgsql/bin/tab.txt';*
>>
>> &add_node(node => 1,host => 'localhost',dbname => 'master',port =>
>> 5455,user => 'postgres',password => '');
>> &add_node(node => 2,host => 'localhost',dbname => 'slave',port =>
>> 5456,user => 'postgres',password => '');
>>
>
> open(INFILE,"<$TABLEFILE");
> my $tables='';
> while(<INFILE>) {
>
> {
>   $line = chomp $_;
>   $tables+=$line;
> }
>
>
>> $SLONY_SETS =
>> {
>>    "set1" =>
>>    {
>>        "set_id" => 1,
>>        "table_id" => 1,
>>        "pkeyedtables" =>
>>                       * [$TABLEFILE,],*
>>
> pkeytables=>$tables  #(replace the above line with this one)
>
>>    }
>> };
>>
>> Kindly assist me, how to achieve this task.
>>
>> Best Regards
>>
>> Raghav
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Slony1-general mailing list
>> Slony1-general at lists.slony.info
>> http://lists.slony.info/mailman/listinfo/slony1-general
>>
>
>


-- 
Best Regards

Raghav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.slony.info/pipermail/slony1-general/attachments/20101010/3e0aaecd/attachment.htm 


More information about the Slony1-general mailing list