Christopher Browne | 3 Dec 2008 22:21

Re: 1 Slave and 2 different masters ?

"Josh Harrison" <joshques@...> writes:
> Can 1 database be a slave for 2 different masters?
> ie., For example I have 2 databases - 1 holding "Instittion-A" data and another database for
"Institution-B" data.
> These 2 database have some common tables with the same table structure.
> Is it possible to have a Slony replication from "Institution A"  database to "SLAVE-x"
> and a slony replication from "Institution-B" database to "SLAVE-x".
> These 2 "Institution" databases wont be accessing the same data...they have their own data but can Slony
replicate them in the same slave?

No, that'll be a problem.

Slony-I wants to truncate the table at the time of subscription, which
would cause a certain amount of inconvenience - you're certain to lose
one institution's set of data when you subscribe the second one.

What you could do instead, that *would* work, would be one of two
things:

  a) Create two separate tables, and combine their data together, when
     querying, by use of a VIEW.

  b) Create a parent table, and have the two tables as "children" via
     the INHERITS functionality, and get a common view, when you need
     it, via selecting from the parent table.

     http://www.postgresql.org/docs/8.3/static/ddl-partitioning.html
--

-- 
select 'cbbrowne' || ' <at> ' || 'linuxfinances.info';
http://linuxfinances.info/info/spreadsheets.html
(Continue reading)

Josh Harrison | 4 Dec 2008 17:57
Picon

Re: 1 Slave and 2 different masters ?

Thanks Chris

On Wed, Dec 3, 2008 at 4:21 PM, Christopher Browne <cbbrowne-swQf4SbcV9C7WVzo/KQ3Mw@public.gmane.org> wrote:
"Josh Harrison" <joshques-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> Can 1 database be a slave for 2 different masters?
> ie., For example I have 2 databases - 1 holding "Instittion-A" data and another database for "Institution-B" data.
> These 2 database have some common tables with the same table structure.
> Is it possible to have a Slony replication from "Institution A"  database to "SLAVE-x"
> and a slony replication from "Institution-B" database to "SLAVE-x".
> These 2 "Institution" databases wont be accessing the same data...they have their own data but can Slony replicate them in the same slave?

No, that'll be a problem.

Slony-I wants to truncate the table at the time of subscription, which
would cause a certain amount of inconvenience - you're certain to lose
one institution's set of data when you subscribe the second one.

What you could do instead, that *would* work, would be one of two
things:

 a) Create two separate tables, and combine their data together, when
    querying, by use of a VIEW.

 b) Create a parent table, and have the two tables as "children" via
    the INHERITS functionality, and get a common view, when you need
    it, via selecting from the parent table.

    http://www.postgresql.org/docs/8.3/static/ddl-partitioning.html
--
select 'cbbrowne' || ' <at> ' || 'linuxfinances.info';
http://linuxfinances.info/info/spreadsheets.html
"you  can   obvioulsy understand what  i'm  saying.  you're just being
pendantic." -- bazzz777-/E1597aS9LQAvxtiuMwx3w@public.gmane.org

_______________________________________________
Slony1-general mailing list
Slony1-general@...
http://lists.slony.info/mailman/listinfo/slony1-general

Gmane