Like on dates fails during cite wfs 1.1 tests againsg postgres 8.3
------------------------------------------------------------------
Key: GEOS-1854
URL: http://jira.codehaus.org/browse/GEOS-1854
Project: GeoServer
Issue Type: Bug
Components: WFS
Affects Versions: 1.6.2
Reporter: Andrea Aime
Assignee: Andrea Aime
Fix For: 1.6.4, 1.7.0-beta1
Running the following wfs query against geoserver + postgres 8.3
{code:xml}
<wfs:GetFeature xmlns:sf="http://cite.opengeospatial.org/gmlsf"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:saxon="http://saxon.sf.net/"
xmlns:p="http://teamengine.sourceforge.net/parsers"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ows="http://www.opengis.net/ows"
xmlns:ctl="http://www.occamlab.com/ctl"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:te="java:com.occamlab.te.TECore"
xmlns:parsers="http://www.occamlab.com/te/parsers"
xmlns="http://www.occamlab.com/ctl"
xmlns:myparsers="http://teamengine.sourceforge.net/parsers"
xmlns:wfs="http://www.opengis.net/wfs"
service="WFS"
version="1.1.0">
<wfs:Query srsName="urn:x-ogc:def:crs:EPSG:6.11.2:4326" typeName="sf:PrimitiveGeoFeature">
<ogc:Filter>
<ogc:PropertyIsLike escapeChar="\" singleChar="?" wildCard="*">
<ogc:PropertyName>sf:dateProperty</ogc:PropertyName>
<ogc:Literal>20*-10-??</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
{code}
results in the following query:
{code}
cite=# SELECT "id", "description", "name", encode(asBinary(force_2d("surfaceProp
erty"),'XDR'),'base64'), encode(asBinary(force_2d("pointProperty"),'XDR'),'base6
4'), encode(asBinary(force_2d("curveProperty"),'XDR'),'base64'), "intProperty", "uriProperty", "measurand", "dateTimeProperty", "dateProperty", "decimalProperty "
FROM "public"."PrimitiveGeoFeature"
WHERE ( "dateProperty" LIKE '20%-10-__' OR "dateProperty" LIKE '20%-10-__ __:__:__' OR "dateProperty" LIKE '20%-10-__ __:__:_____' );
{code}
that works fine on my postgres 8.1.5, but fails with the following error message on gridlock's windows VM:
{code}
ERROR: operator does not exist: timestamp with time zone ~~ unknown
LINE 1: ...ic"."PrimitiveGeoFeature" WHERE ( "dateProperty" LIKE '20%-...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
{code}
Modifying the query as follows (explicit cast of fields to varchar) make it work on pg 8.3 as well:
{code}
cite=# SELECT "id", "description", "name", encode(asBinary(force_2d("surfaceProp
erty"),'XDR'),'base64'), encode(asBinary(force_2d("pointProperty"),'XDR'),'base6
4'), encode(asBinary(force_2d("curveProperty"),'XDR'),'base64'), "intProperty",
"uriProperty", "measurand", "dateTimeProperty", "dateProperty", "decimalProperty
" FROM "public"."PrimitiveGeoFeature" WHERE ( "dateProperty"::varchar LIKE '20%
-10-__' OR "dateProperty"::varchar LIKE '20%-10-__ __:__:__' OR "dateProperty":
:varchar LIKE '20%-10-__ __:__:_____' );
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira