Re: "duplicate key violates unique constraint" error

From: Richard Huxton <dev(at)archonet(dot)com>
To: tamanna madaan <tamanna(dot)madan(at)globallogic(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Ashish Sharma <ashish(dot)sharma(at)globallogic(dot)com>, Gaurav Katiyar <gaurav(dot)katiyar(at)globallogic(dot)com>
Subject: Re: "duplicate key violates unique constraint" error
Date: 2009-11-12 10:33:22
Message-ID: 4AFBE472.6030408@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

tamanna madaan wrote:
>
> I am getting this error "duplicate key violates unique constraint" in
> my slon.log on slave . This error is thrown while
>
> Slon is inserting a row in a table on slave. This must be because of
> the reason that duplicate rows
>
> are being returned while querying sl_log_1 table.

And are there any errors in the PostgreSQL logs? Does this table contain
duplicates?

> I googled about the
> same problem and found that
>
> there is some bug in postgres due to which some table or index on that
> table gets corrupted. Due to this

What bug? Do you have a number or mailing-list reference?

> I am using postgres 8.1.2 and slony 1.1.5 .
>
> Please suggest which version of postgres has fix for above mentioned
> problem.

I'm not sure it's clear what problem we're talking about here.

However, you are missing *16* updates for PostgreSQL (8.1.18) and four
for slony (1.1.9).

First step - get a fresh cup of tea or coffee, read through the release
notes between 8.1.2 and 8.1.18 and once you are happy upgrade. Do the
same for slony.

Then, if the slony sl_log table(s) have errors, I'd probably restart the
whole replication from scratch. I'd never be happy that I'd found all
the problems and corrected them.

If you are starting the replication from base, it might make sense to
upgrade slony to 1.2.17 while you're doing so.

HTH

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2009-11-12 10:38:27 Re: knowing which table/schema is going to be chosen
Previous Message Andreas 'ads' Scherbaum 2009-11-12 10:26:17 Re: pgday.eu