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'm trying to import a shape file to my PostGIS database but I can not, give a look:

Importing with configuration: 12mie250gc_sir, public, geom, / home/samuelribeiro/Desktop/MALHA_DIGITAL/ac/12MIE250GC_SIR, mode = c, dump = 1, simple = 0, geography = 0, index = 1, shape = 1, srid = 4326
Shapefile type: PolygonM
PostGIS type: MULTIPOLYGONM [3]
Failed SQL begins: "SET TO UTF8 CLIENT_ENCODING;
STANDARD_CONFORMING_STRINGS SET TO ON;
BEGIN;
CREATE TABLE "public". "12mie250gc_sir" (gid serial,
"id" float8
"nm_micro" varchar (100),
"cd_geocodu" varchar (2));
ALTER TABLE "public". "12mie250gc_sir" ADD PRIMARY KEY (gid);
SE "
Failed in pgui_exec (): ERROR: function AddGeometryColumn (unknown, unknown, unknown, unknown, unknown, integer) is not unique
LINE 9: SELECT AddGeometryColumn ('public', '12mie250gc_sir ',' geom ', '4 ...
                ^
HINT: Could not choose a best candidate function. You might need to add explicit type casts.

Shapefile import failed.
share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

Looks like you're loading into a database that either (a) has a version of PostGIS installed that doesn't match the loader or (b) has no PostGIS installed at all. Run "select postgis_full_version()" in your target database and see if it's the version you expect.

share|improve this answer
add comment

You can try the opensource ogr2ogr-tool to import the shapefile:

command would be something like this:

ogr2ogr -f "ESRI Shapefile" mydata.shp PG:"host=myhost user=myloginname dbname=mydbname password=mypassword" "mytable"

Information can be found in this cheatsheet

share|improve this answer
    
it works for me..thanks : ) –  Sunil Dec 18 '12 at 11:27
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.