[postgis-users] Loading Shape Files into PostGIS 2.0

Paul Michell Paul at michellcomputing.co.uk
Mon Jun 18 07:24:53 PDT 2012


We have recently upgraded our server to PostGIS 2.0/PostgreSQL 9.1 Windows 
64bit. Previously we have loaded data by copying shapefiles using OGR2OGR or 
our own GDAL based code.  These methods now fail.  At first I thought it was a 
GDAL bug, but the same error occurs when manually performing the import via 
shp2pgsql-gui.exe.

Here is the console output from the input:
-----------------------------------------------------------------------------------------

Connecting:  host=localhost port=5432 user=GISUser password='********' 
dbname=HCA
Connection succeeded.
Connecting:  host=localhost port=5432 user=GISUser password='********' 
dbname=HCA

==============================
Importing with configuration: highways_structures2, public, geom, C:\Documents 
and Settings\mikeh\My Documents\Highways_Structures2, mode=c, dump=1, 
simple=0, geography=0, index=1, shape=1, srid=0
Shapefile type: Polygon
PostGIS type: MULTIPOLYGON[2]
Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "public"."highways_structures2" (gid serial,
"join_count" int4,
"id" int4,
"town" varchar(50),
"additional" varchar(200),
"cra_catego" varchar(50),
"site_addre" varcha"
Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, unknown, 
unknown, unknown, unknown, integer) is not unique
LINE 36: SELECT AddGeometryColumn('public','highways_structures2','ge...
                ^
HINT:  Could not choose a best candidate function. You might need to add 
explicit type casts.

Shapefile import failed.

-----------------------------------------------------------------------------------------

Is there something I'm overlooking, or is there a PostGIS 2.0 bug?

Thanks,

Paul
-- 
Paul Michell MSc BA MBCS
Michell Computing



More information about the postgis-users mailing list