Christopher Browne cbbrowne
Tue Mar 1 15:18:22 PST 2005
sarlav kumar <sarlavk at yahoo.com> writes:
> Hi,
>
> I have a table "id_code_translation" with the
> following schema:
> -------------------------------------------------------
> id - integer, not null default nextval
> ('public.id_code_translation_id_seq'::text)
>
> identity_id - integer
> response_code - character varying(4)   
> description - character varying(100)  
> match - boolean 
>
> "$1" FOREIGN KEY (identity_id) REFERENCES
> identity_entity(id)
> ------------------------------------------------------
>
> I added this table to a replication set with id as
> candidate key. When I initialised the cluster, I got
> the following error message:
>
> <stdin>:43: PGRES_FATAL_ERROR select
> "_ikobo_test1".determineIdxnameUnique('public.id_code_translation',
> 'id');  - ERROR:  Slony-I: table
> public.id_code_translation has no unique index id
>
>
> As "id" is serial, is it not by default unique? Do I
> need to add unique constraints on serial fields so
> that they can be used as candidate keys?

It may by coincidence be unique, but you do not have a candidate
primary key on that column, which is what Slony-I requires.

No index ==> No good.

At one time, creating a serial field in PostgreSQL implied that a
unique index was added; that has no longer been a feature for some
years now.
-- 
"cbbrowne","@","ca.afilias.info"
<http://dev6.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)


More information about the Slony1-general mailing list