cbbrowne at ca.afilias.info cbbrowne
Thu Apr 14 13:41:37 PDT 2005
> psql master <<_EOPSQL_
> drop table test2;
> create table test2 (testid int unique not null);
> _EOPSQL_
>
> ## slony init stuff goes here
> ....
> ## init stuff end
>
> set add table (set id=1, origin=1, id=2, fully qualified name =
> 'public.test2', key = 'testid' );
> #########
>
> 'set add table' fails with error:
>
> <stdin>:14: PGRES_FATAL_ERROR select
> "_test".determineIdxnameUnique('public.test2', 'testid');  - ERROR:
> Slony-I: table public.test2 has nounique index testid
>
> I can add a table _only_ if I create primary key, but sometimes I
> cannot do this (because of existing multi-column PKEYs).
>
> Is this a bug, or I'm missing something?

<http://linuxfinances.info/info/definingsets.html>

If you have got a key that is defined as a primary key, then Slony-I can
pick it up automatically.

If you have a candidate primary key (that is, an index that is unique and
not null, but which is NOT the primary key constraint on the table), then
you'll have to give Slony-I a hint by telling it which such index to use
as its key.  After all, there could be several candidates.



More information about the Slony1-general mailing list