I'm trying to convert a query into uppercase in a GeoServer WFS request. According to the Filter Function reference this can be achieved using strToUpperCase()
.
This is working successfully on a sample GeoServer site where both of these queries return the expected result "STATE_NAME": "Illinois"
However, on my own GeoServer (version 2.10.2), an equivalent cql_filter
(against a text field) works correctly without strToUpperCase
:
... but fails with the following error when I include the strToUpperCase
filter function:
<ServiceException>
java.lang.RuntimeException: java.io.IOException java.io.IOException
Cannot do natural order without a primary key, please add it or
specify a manual sort over existing attributes
</ServiceException>
The layer's data source is a PostgreSQL table with the field defined as character varying
, and there is an ascending index on that field.
Other layers in my local GeoServer, which are sourced from the same PostgreSQL instance, do not exhibit this error when I use strToUpperCase
so the problem appears to be isolated to this layer/PostgreSQL table.
How can I debug this problem and allow the use of strToUpperCase
on this dataset?