One Star

PostGis issue

Hello,
I have some trouble with one of the jobs from demo-spatial.
It's test_PostGis job. After running it raise an exception :

Exception in component tPostgresqlOutput_1
org.postgresql.util.PSQLException: ERROR: function geomfromtext(character varying, integer) does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:304)
at demo_spatial.test_postgis_0_1.test_PostGis.sShapefileInput_1_GIProcess(test_PostGis.java:1154)
at demo_spatial.test_postgis_0_1.test_PostGis.main(test_PostGis.java:1359)


At line 867 in generated code :

String insert_tPostgresqlOutput_1 = "INSERT INTO \""
+ tableName_tPostgresqlOutput_1
+ "\" (\<"the_geom\",\"scalerank\") VALUES (GeomFromText(?, ?),?)";


--> It's not a known function by PostGis indeed !!
My version of postgis is

"POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.7.8""


Any ideas ?
Thanks ...
Eric.

3 REPLIES
One Star

Re: PostGis issue

An idea: https://drupal.org/node/1529808#comment-6082738
"I'm not particularly familiar with the PostGIS releases but it seems that non-prefixed function names have been deprecated for a while now and removed entirely in the 2.x branch.
A temporarily solution for those using PostGIS 2.x is to run the bundled legacy.sql script on your database..."
GeomFromText seems to be deprecated with PostGIS 2.x so you must use ST_GeomFromText, or run the bundled legacy.sql script on your database.
See http://postgis.refractions.net/docs/PostGIS_FAQ.html#legacy_faq for the legacy.sql for PostGIS.
One Star

Re: PostGis issue

Thast'it...
Thanks a lot...
I just had to run legacy.sql from postgis install.
Seventeen Stars

Re: PostGis issue

i have the same problem Smiley Sad