Tue Aug 8 08:29:56 PDT 2006
- Previous message: [Slony1-general] Slony-I+Partitioned tables
- Next message: [Slony1-general] Slony-I+Partitioned tables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Devrim GUNDUZ wrote: > Hello, > > Has anyone tried Slony-I on a partitioned table? > > I'm working on some tests per a question from a local user. He says that > he cannot add child tables to replication set, because child the table > does not have primary keys. Because of DO INSTEAD, no data is inserted > to master table, so there is no replication :( > > Any solution on this? > > I thought of adding a trivial serial column to each child table, which > will act as a primary key; so that I can add them into replication > set. > > Does it sound good? > I recently added an example involving inheritance to the set of regression tests, and it works fine :-). But note that I expressly added primary keys to each 'sub table': ------------------------------------------------------------------ create table master ( id serial primary key, trans_on timestamptz default 'now()', data text ); create table sub1 ( ) inherits (master); alter table sub1 add primary key(id); create table sub2 ( ) inherits (master); alter table sub2 add primary key(id); create table sub3 ( ) inherits (master); alter table sub3 add primary key(id); ------------------------------------------------------------------ The example doesn't add constraints and "DO INSTEAD" triggers; that would be an interesting addition.
- Previous message: [Slony1-general] Slony-I+Partitioned tables
- Next message: [Slony1-general] Slony-I+Partitioned tables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list