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!
-
1What method are you using to upload the shapefile? This looks a little like the error from the SPIT upload tool in QGIS.djq– djq2012年10月28日 19:16:17 +00:00Commented Oct 28, 2012 at 19:16
-
1Do you have the PostGIS components installed? Try SELECT postgis_full_version();Micha– Micha2012年10月28日 19:38:34 +00:00Commented Oct 28, 2012 at 19:38
2 Answers 2
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).
-
Same problem also coming to me, I installed Postgis/Postgresql Properly. I didn;t get what is the problem with AddGeometrycolumn?Satya Chandra– Satya Chandra2013年04月17日 05:55:42 +00:00Commented Apr 17, 2013 at 5:55
Try to execute legacy.sql for your database.
On unix you can do that by running
psql my_postgis_db -f <installdir>/postgresql/share/contrib/postgis-2.0/legacy.sql
For windows I think you can use pgAdmin if I am not mistaken. Search your installation directory for legacy.sql . It should be somewhere there.