Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey" - Mailing list pgsql-admin

From Ankur Kaushik
Subject Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"
Date
Msg-id CALXoLqxpkMWc3hO+pkWF_r0UyTVH-8Qtgd=GqX0yyWY9FfMX0A@mail.gmail.com
Whole thread Raw
In response to Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Responses Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"
List pgsql-admin

After PostGIS installation what is did executed the below command

-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- fuzzy matching needed for Tiger
CREATE 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.albe@wien.gv.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

pgsql-admin by date:

Previous
From: Kiswono Prayogo
Date:
Subject: Slow when joining with view
Next
From: Albe Laurenz
Date:
Subject: Re: ERROR: duplicate key value violates unique constraint "geocode_settings_pkey"