On Tue, 2006-04-04 at 11:08, Miguel wrote:
> hi, this a design database question , i have a detail table that only 
> have 4 columns, i want ot replicate it with slony:
> 
> CREATE TABLE horarios_general
> (
>   idplan int4 NOT NULL,
>   idhorario int4 NOT NULL,
>   dia_inicio int4 NOT NULL,
>   dia_fin int4 NOT NULL,
>   hora_inicio time NOT NULL,
>   hora_fin time NOT NULL
> )
> 
> it doesnt have a primary key, would it be a problem if the key is 
> confirmed of all the table's columns?, is that recommended?

You can either create a column with a serial type and make it the
primary key (i.e. an "artificial" primary key) or use all the columns.

The problem with using all the fields as a primary key is performance. 
The single column index for an int / int8 is gonna be smaller and
cheaper to update.  OTOH, if you really should have a unique
multi-column index on this table for the sake of your data, then you
might as well make it and use it.

Either one will make slony happy.
_______________________________________________
Slony1-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/slony1-general

Reply via email to