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

From: Ankur Kaushik <ankurkaushik(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "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-17 08:58:29
Message-ID: CALXoLqxpkMWc3hO+pkWF_r0UyTVH-8Qtgd=GqX0yyWY9FfMX0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

After PostGIS installation what is did executed the below command

-- Enable PostGIS (includes raster)CREATE EXTENSION postgis;-- Enable
TopologyCREATE EXTENSION postgis_topology;-- fuzzy matching needed for
TigerCREATE EXTENSION fuzzystrmatch;-- Enable US Tiger Geocoder

CREATE EXTENSION postgis_tiger_geocoder;

So there install the new schema tiger , which contains some table and data
for Geo.

Now while restoring full database backup from other database server which
already contain tiger schema thus it shows duplicate error for tiger schema
while restoring the database on blank server.
Consequence is If only Public schema data is restored on other server its
shows geometric error even if you have already installed tiger schema .

So is there any way to restore database without any error , or Can we put
one line in database backup file , DROP TABLE 'table name' just before
CREATE TABLE.

On Mon, Jun 15, 2015 at 9:31 PM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
wrote:

> Ankur Kaushik wrote:
> > I think this is not a database corrupt , While create a new database
> there is already Entry in
> > geocode_setting tiger schema . Correct me If I am Wrong .
>
> Well, you wrote that you were restoring to a "fresh database server", so I
> was assuming
> that the database was empty.
>
> Preexisting data can of course also lead to this problem.
>
> Yours,
> Laurenz Albe
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Albe Laurenz 2015-06-17 09:43:27 Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"
Previous Message Kiswono Prayogo 2015-06-16 08:10:28 Slow when joining with view