Skip to main content
naming
Link
Vince
  • 20.5k
  • 16
  • 49
  • 65

MapServer PostgresPostgreSQL WHERE clause with UUID column fails

naming
Source Link
Vince
  • 20.5k
  • 16
  • 49
  • 65

I'm using MapServer with PostgresPostgreSQL and I need to be able to limit the query using a UUID field. This column type is not mentioned in the documentation.

I can happily use other field types in the WHERE clause e.g.

DATA "geometry from (SELECT id_uuid, geometry, projectid, style_description from project.mytable where ukcode = 'a4c' and area_hectares < 0.0001) as subquery USING unique id_uuid USING srid=27700"

that works. But when I try and use a uuid column in the where clause like this...

DATA "geometry from (SELECT id_uuid, geometry, projectid from project.mytable where projectid = '61ff8678-8e45-496b-9aa8-f72b9a328175') as subquery USING unique id_uuid USING srid=27700"

I receive this error

msWFSGetFeature(): WFS server error. ms_error->code not found msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs

I can't get the error logs working which doesn't help.

I've also tried casting e.g. '61ff8678-8e45-496b-9aa8-f72b9a328175'::uuid but same result. I've also tried this in a Filter but its the same problem.

Have I got the correct syntax? Does anyone know - should I be able to query by uuid? Perhaps this isn't allowed but its not in the documentation

I'm using MapServer with Postgres and I need to be able to limit the query using a UUID field. This column type is not mentioned in the documentation.

I can happily use other field types in the WHERE clause e.g.

DATA "geometry from (SELECT id_uuid, geometry, projectid, style_description from project.mytable where ukcode = 'a4c' and area_hectares < 0.0001) as subquery USING unique id_uuid USING srid=27700"

that works. But when I try and use a uuid column in the where clause like this...

DATA "geometry from (SELECT id_uuid, geometry, projectid from project.mytable where projectid = '61ff8678-8e45-496b-9aa8-f72b9a328175') as subquery USING unique id_uuid USING srid=27700"

I receive this error

msWFSGetFeature(): WFS server error. ms_error->code not found msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs

I can't get the error logs working which doesn't help.

I've also tried casting e.g. '61ff8678-8e45-496b-9aa8-f72b9a328175'::uuid but same result. I've also tried this in a Filter but its the same problem.

Have I got the correct syntax? Does anyone know - should I be able to query by uuid? Perhaps this isn't allowed but its not in the documentation

I'm using MapServer with PostgreSQL and I need to be able to limit the query using a UUID field. This column type is not mentioned in the documentation.

I can happily use other field types in the WHERE clause e.g.

DATA "geometry from (SELECT id_uuid, geometry, projectid, style_description from project.mytable where ukcode = 'a4c' and area_hectares < 0.0001) as subquery USING unique id_uuid USING srid=27700"

that works. But when I try and use a uuid column in the where clause like this...

DATA "geometry from (SELECT id_uuid, geometry, projectid from project.mytable where projectid = '61ff8678-8e45-496b-9aa8-f72b9a328175') as subquery USING unique id_uuid USING srid=27700"

I receive this error

msWFSGetFeature(): WFS server error. ms_error->code not found msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs

I can't get the error logs working which doesn't help.

I've also tried casting e.g. '61ff8678-8e45-496b-9aa8-f72b9a328175'::uuid but same result. I've also tried this in a Filter but its the same problem.

Have I got the correct syntax? Does anyone know - should I be able to query by uuid? Perhaps this isn't allowed but its not in the documentation

Source Link

MapServer Postgres WHERE clause with UUID column fails

I'm using MapServer with Postgres and I need to be able to limit the query using a UUID field. This column type is not mentioned in the documentation.

I can happily use other field types in the WHERE clause e.g.

DATA "geometry from (SELECT id_uuid, geometry, projectid, style_description from project.mytable where ukcode = 'a4c' and area_hectares < 0.0001) as subquery USING unique id_uuid USING srid=27700"

that works. But when I try and use a uuid column in the where clause like this...

DATA "geometry from (SELECT id_uuid, geometry, projectid from project.mytable where projectid = '61ff8678-8e45-496b-9aa8-f72b9a328175') as subquery USING unique id_uuid USING srid=27700"

I receive this error

msWFSGetFeature(): WFS server error. ms_error->code not found msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs

I can't get the error logs working which doesn't help.

I've also tried casting e.g. '61ff8678-8e45-496b-9aa8-f72b9a328175'::uuid but same result. I've also tried this in a Filter but its the same problem.

Have I got the correct syntax? Does anyone know - should I be able to query by uuid? Perhaps this isn't allowed but its not in the documentation