[Bucardo-general] Replication failure because of duplicate key violation

David Christensen david at endpoint.com
Thu Feb 20 16:40:33 UTC 2020


> On Feb 20, 2020, at 2:07 AM, Sai Prasad <spchinna25 at gmail.com> wrote:
> 
> Hi David,
> 
> I missed one more point to mention above,
> We couldn't find the cause for duplicate values for entries from NMS. Is there any way to find out the duplicates and eliminate them from tables using postgresql/bucardo? Will custom codes help us ?
> I would be grateful if you provide any other way forward to fix the case using bucardo features.
> 
> BR,
> Sai

Hi Sai,

Usually you have to look at the PostgreSQL logs to see which tables/fields are conflicting due to unique violations; it wouldn’t be the Bucardo Primary Keys, because it uses session_replication_role and deletes the target rows based on that PK from the source, so nothing is there to conflict.  Once you’ve identified the table or tables that have the unique violations you can decide on which set of conflict records is canonical and delete or merge the other ones.  (This tends to be very application-specific, so other than outline the basic idea I can’t provide specific guidance.)

HTH,

David
--
David Christensen
Senior Software and Database Engineer
End Point Corporation
david at endpoint.com
785-727-1171



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://bucardo.org/pipermail/bucardo-general/attachments/20200220/4ae545ba/attachment.sig>


More information about the Bucardo-general mailing list