One Star

load problem (shape file to postgres)

Hello ,
when I try to load a shape file into a potgis DB , this notification appear and I can't understand it .

L'élément du batch 0 INSERT INTO "public"."metadata" ("the_geom","ZID","NAME","ELEV","ICON") VALUES (GeomFromText('POINT (1.43753035191483 43.5925304098064)', 4326),0,'kml_1',0.0,81) a été annulé. Appeler getNextException pour en connaître la cause.

  • SDI
5 REPLIES
One Star Fxp
One Star

Re: load problem (shape file to postgres)

Hi, I can't reproduce the issue. Which version of PostGIS are you using ?
Could you also test a simple job with sGeomTxtInput > tPostgresqlOutput and see if you get the same error ?
Thanks.
Francois
One Star nko
One Star

Re: load problem (shape file to postgres)

I'm trying to execute this simple job you proposed (sGeomTxtInput > tPostgresqlOutput), but i have the same problem, maybe due to the function "geomfromtext" which should have a prefix "ST_" and the single quotes on "POINT(1 2)".
I'm using Talend DI 5.2.2 and TOS Spatial 5.2.1 on postgresql v 9.2.
Have someone fixed this issue?
Thanks
One Star nko
One Star

Re: load problem (shape file to postgres)

After googoling a lot i found the solution.
The problem is related to the version of postgis. In version 2.0 the geomfromtext function has been deprecated and replaced with the suffix "ST_", as well as all the geometry functions.
Then is enough to run the legacy.sql script (located in: C:\ProgramFiles\PostgreSQL\9.2\share\contrib\postgis-2.0) and it work immediately without the need to restart both postgres or TOS.
Bye
Nico
PLEASE SET THE TOPIC AS SOLVED
One Star

Re: load problem (shape file to postgres)

Hi NKO,

I have a similar issue,
Can you please send me the legacy.sql script ?
Thanks,
Stefan
One Star nko
One Star

Re: load problem (shape file to postgres)

Hi, you can simply find it in your installation directory of Postgis within the PostgreSQL X.X folder.
C: ........ PostgreSQL\9.2\share\contrib\postgis-2.0