Christopher Browne cbbrowne
Fri May 13 16:17:18 PDT 2005
Thomas Go wrote:

>
> I thought I had set this up properly when I created the cluster?but
> I'm getting the following mesg.
>
> dns_data=# INSERT INTO domains (name, type) VALUES ('5th.kz', 'NATIVE');
> ERROR: duplicate key violates unique constraint "domains_pkey"
>
> We have 2 table something call dom and rec. I have set this under the
> create set
>
> create set (id=1, origin=1, comment='');
> set add table (set id=1, origin=1, id=1, fully qualified name =
> 'public.dom', comment='domain table');
> set add table (set id=1, origin=1, id=2, fully qualified name =
> 'public.rec', comment='records table');
>
> But I'm still getting the key violates. I would insert it a few time
> and then it'll go through. Any thoughts?
>
Could you show the schema for the table domains? (I can probably make a
more-than-merely-educated guess, but I'll ask :-))

I'll bet the primary key is on an ID field, more than likely called
domain_id, populated by a sequence.

That sequence needs to be replicated, and I'll bet it isn't.

This would be particularly likely to occur if you do a MOVE SET, which
then means the table on the _new_ origin has the sequence value reset to
a too-low value so that it will periodically conflict with existing
domain_id values. Deleted domains would leave gaps, with the result that
the failures would be sporadic.

Replicate the sequence and the "Slony-I partly to blame" part goes away.

It is also possible that the sequence was just plain wrongly set, in
which case it's not a Slony-I issue at all. (That has happened to me
once or twice...)


More information about the Slony1-general mailing list