Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Ankur Kaushik *EXTERN*'" <ankurkaushik(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"
Date: 2015-06-15 09:57:49
Message-ID: A737B7A37273E048B164557ADEF4A58B50F5D01D@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ankur Kaushik wrote:
> I took Backup using below command
> pg_dump "database name" | gzip > /root/dump.sql.gz
>
>
>
> While restoring in fresh PostgreSQL server getting below error .
>
> ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"
> DETAIL: Key (name)=(debug_geocode_address) already exists.

That looks like data corruption on the original database.

Look at https://wiki.postgresql.org/wiki/Corruption and
follow the "VITALLY IMPORTANT FIRST RESPONSE".

Check if that is the only row that violates the constraint.
You could manually delete all offending rows on the source,
then dump/restore (don't continue working with the database
even if it seems consistent again).

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ankur Kaushik 2015-06-15 11:19:21 Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"
Previous Message Ankur Kaushik 2015-06-15 09:42:41 ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"