[GIS] How to import shp files into postgresql with PostGIS

postgispostgresql

I'm a new user of postgreSQL/postgis but I'm having a problem.

I'm trying to import some shapefiles (which open perfectly in QGIS or ArcGIS but create an error when i import them). The problem is not because it's in a directory with accents (that was my first problem).

When loading the data, I get this message :

> Importing with configuration: nyc_neighborhoods, public, geom,
> C:\Users\Lay\Desktop\NYC\nyc_neighborhoods, 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"."nyc_neighborhoods" (gid serial, "boroname" varchar(43),
> "name" varchar(64)); ALTER TABLE "public"."nyc_neighborhoods" ADD
> PRIMARY KEY (gid); SELECT AddGeomet" Failed in pgui_exec(): ERREUR: 
> la fonction addgeometrycolumn(unknown, unknown, unknown, unknown,
> unknown, integer) n'existe pas LINE 8: SELECT
> AddGeometryColumn('public','nyc_neighborhoods','geom'...
>                ^ HINT:  Aucune fonction ne correspond au nom donné et aux types d'arguments. Vous devez ajouter des conversions explicites
> de type.
> Shapefile import failed.

It's in french though I installed postgis in english to avoid this problem. It says that there is no specific function associated and given to the different types of arguments and that i have to add specific conversions. However, I do not really get what this error means or how I can solve it. I hope some off you know!!

Thanks!

Best Answer

Using google translate, the message you are getting appears to be :

No function matches the given name and argument types

I suspect you do not have PostGIS installed, or enabled on the database you are trying to import data to. The AddGeometryColumn function comes with PostGIS (which is an extension to postgresql).

Related Question