Scott Marlowe scott.marlowe at gmail.com
Thu Oct 29 17:39:26 PDT 2015
On Thu, Oct 29, 2015 at 6:06 PM, Sung Hsin Lei <sungh.lei at gmail.com> wrote:
> Hello,
>
> I successfully update the main db and one replicated db with the following:
>
> cluster name = slony_rep1
>
> node 1 admin conninfo = 'dbname = MyDB host = localhost user = slony1
> password = Ejhfg33EdddsufhErR76 port = 6234';
> node 2 admin conninfo = 'dbname = MyDB host = 86.88.5.4 user = slony1
> password = Ejhfg33EdddsufhErR76 port = 6234';
>
> EXECUTE SCRIPT
> (
>     SQL = 'ALTER TABLE operators RENAME COLUMN firstname TO lastname;',
>     EVENT NODE = 1
> );
>
>
>
>
> However, I have 1 main db to 2 replicated db. The second replicated db has
> the following cluster name and node information:
>
> cluster name = slony_rep2
>
> node 1 admin conninfo = 'dbname = MyDB host = localhost user = slony2
> password = Ejhfg33EdddsufhErR76 port = 6234';
> node 2 admin conninfo = 'dbname = MyDB host = 86.88.5.17 user = slony2
> password = Ejhfg33EdddsufhErR76 port = 6234';

Shouldn't that be node 3 not node 2?

> Do I need to run slonik twice with different cluster and node indo? That
> does not seem right. After running the first time, the main db and the first
> replicated db will be consistent but not the second replicated db. Also, if
> I run it a second time, wouldn't the main db already be updated hence the
> sql statements used for the original update will surely fail?

You can just run it on all three at once.

node 1 admin conninfo = 'dbname = MyDB host = localhost user = slony1
password = Ejhfg33EdddsufhErR76 port = 6234';
node 2 admin conninfo = 'dbname = MyDB host = 86.88.5.4 user = slony1
password = Ejhfg33EdddsufhErR76 port = 6234';
node 3 admin conninfo = 'dbname = MyDB host = 86.88.5.17 user = slony2
password = Ejhfg33EdddsufhErR76 port = 6234';

EXECUTE SCRIPT
(
    SQL = 'ALTER TABLE operators RENAME COLUMN firstname TO lastname;',
    EVENT NODE = 1
);


More information about the Slony1-general mailing list