0

I'm trying to import a shapefile 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.
3

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.

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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