Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to load a shapefile (http://dds.cr.usgs.gov/pub/data/nationalatlas/statesp020_nt00032.tar.gz) into PostGIS 2.0.1 using pgAdmin3's PostGIS Shapefile Import/Export Tool.

enter image description here

However its not allowing me to import the shapefile, showing the error messages below. Any idea what happen?

Output from PostGIS Shapefile Import/Export Tool

==============================
Importing with configuration: statesp020, staging, geom, C:\gisdata\statesp020_nt00032\statesp020, mode=c, dump=1, simple=0, geography=0, index=0, shape=1, srid=4269
Shapefile type: Polygon
PostGIS type: MULTIPOLYGON[2]
Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "staging"."statesp020" (gid serial,
"area" float8,
"perimeter" float8,
"statesp020" float8,
"state" varchar(20),
"state_fips" varchar(2),
"order_adm" int4,
"month_adm""
Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist
LINE 15: SELECT AddGeometryColumn('staging','statesp020','geom','4269...
                ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Shapefile import failed.
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

It looks like the loader you're using is from 1.5 or lower, while the database you're loading to is 2.0. Either (a) move to the latest loader or (b) add the "legacy.sql" file into your postgis database to ensure that all the old function signatures the old loader expects are available to you.

share|improve this answer
    
I cant seem to find the newest shp2pgsql-gui.exe loader for Windows, im using the latest version that I can find. Any hints on where to get the updated version? –  Nyxynyx Apr 3 '13 at 0:12
    
Particularly on Windows I'd expect it to be bundled with the latest PostGIS software... afraid I can't help you. –  Paul Ramsey Apr 3 '13 at 16:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.