When I try to Import Shapefile into PostGIS using DB Manger Plugin in QGIS the error message show

"Error 3
Creation of data source "TEST_EST_MILION" failed: 
ERROR:  function addgeometrycolumn(unknown, unknown, unknown, integer, unknown, integer) does not exist
LINE 1: SELECT AddGeometryColumn('','TEST_EST_MILION',NULL,32640,'MU...
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
  • 2
    is PostGIS enabled in the DB? It is in the user path? – JGH Sep 4 at 16:24
  • Do you mean the Connection ? – GIS_Q Sep 5 at 6:00
  • no, I am talking about the PostGIS extension. See this for more details – JGH Sep 5 at 11:03

I don't use QGIS to import data but let me give you a working solution if you are able to use ogr2ogr.

ogr2ogr -f "PostgreSQL" "PG:host=serverhost user=username dbname=dbname password=password" yourshpfile.shp -lco GEOMETRY_NAME=the_geom -lco FID=gid -lco PRECISION=no -nlt PROMOTE_TO_MULTI -nln tablename -t_srs "EPSG:4326"

Add your own credentials and set the SRID to your needs. Add -overwrite if you want the layers to be erased on import.

  • 1
    +1 a good backup to know when other things do not work – artwork21 Sep 4 at 18:05
  • Thank you.Where i can put this configuration . i am not familiar with this – GIS_Q Sep 5 at 5:59
  • @GIS_Q Well, as @JGH said in his comment above, before anything else check if PostGIS is enabled in the DB, sometimes people enable it globally and it doesn't work. If you are using PostgreSQL with the command line you can do it by connecting to the database with postgres=# \c DBNAME then postgres=# CREATE EXTENSION postgis; – egdavid Sep 5 at 9:00

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.