Problem with the entities generated by TAureliusConnection for the geometry column of Postgres

Hi,

My intention is to use PostgreSQL with PostGIS in a Apache loadable module on Ubuntu server.
I downloaded the demo data from Lee County, Florida as a shape file and, using QGIS, imported it into Postgres and created a spatial table (containing the geom column).

The idea is to execute typical spatial related SQL in XDataWebClient, e.g.
SELECT round((ST_Distance('SRID=4326;POINT(-25.745994 28.203887)'::geography,
          'SRID=4326;POINT(-26.211253 28.025733)'::geography)/1000)::numeric, 0) as dist

I'm able to compile the program (my libmod_slimzulu.so) and deploy it to Ubuntu server but if I start Apache (sudo service apache2 start), I get the following response:

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Tue 2020-08-11 11:39:43 SAST; 22s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2146 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 2398 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Aug 11 11:39:43 ubuntu apache2[2398]:  *
Aug 11 11:39:43 ubuntu apache2[2398]:  * The apache2 configtest failed.
Aug 11 11:39:43 ubuntu apache2[2398]: Output of config test was:
Aug 11 11:39:43 ubuntu apache2[2398]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/
Aug 11 11:39:43 ubuntu apache2[2398]: Action 'configtest' failed.
Aug 11 11:39:43 ubuntu apache2[2398]: The Apache error log may have more information.
Aug 11 11:39:43 ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 11 11:39:43 ubuntu systemd[1]: Failed to start LSB: Apache2 web server.
Aug 11 11:39:43 ubuntu systemd[1]: apache2.service: Unit entered failed state.
Aug 11 11:39:43 ubuntu systemd[1]: apache2.service: Failed with result 'exit-code'.

If I then comment out all lines referring to the geom column, compile and deploy to Ubuntu server then I'm able to successfully restart Apache.

I attach the unit containing the entities created by TAureliusConnection from the database. Note that all lines referring to the geom column are commented out.

If I can't do spatial SQL queries using XDATA server then my other option is to create the rest server by using PostgREST

Regards,

Nols SmitUnit1.zip (1.6 KB)

Geometry data type is not supported by Aurelius. You can still use XData, but then you will have to create the SQL statements manually, as showed in this example:

Hi,

Thank you for the reply but I'm not creating a Windows service but an Apache loadable module.
What I figured out is one can't use a TXDataServer and a TSparkleHttpSysDispatcher component when creating a Apache loadable module.

What I'm looking for is a Linux version of the demo to create a back-end server

I worked thru part 5:xdata/aurelius server and created a Apache loadable module but it seems XDataServer is not involved and therefore I can't set the DefaultEntitySetPermissions

Also, if I know how to create my own back-end procedures in my Apache loadable module then I can use it to call database procedures to do my spatial queries.

Regards

Nols Smit

As

That is not correct. You can. The problem is just because you are trying to use Geometry data types with Aurelius which are not supported!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.