One Star

PostGis issue

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(
at org.postgresql.core.v3.QueryExecutorImpl.processResults(
at org.postgresql.core.v3.QueryExecutorImpl.execute(
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(
at demo_spatial.test_postgis_0_1.test_PostGis.sShapefileInput_1_GIProcess(
at demo_spatial.test_postgis_0_1.test_PostGis.main(

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 ...

  • SDI
One Star

Re: PostGis issue

An idea:
"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 for the legacy.sql for PostGIS.
One Star

Re: PostGis issue

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