Hi,<br><br>I have created a database on PostgreSQL version 8.0.3. I have translated my shapefile to an sql file using shp2pgsql version 1.1.2 from PostGIS. I have created and populated my table correctly with the result sql command file.
<br><br>gid | location | time | imgdate | the_geom<br>-----+----------+------+---------+----------<br><br>I am using WMS with timedefault, timeitem and timeextent:<br><br> METADATA<br> wms_title "denis"
<br> wms_timeextent "2006-01-01/2006-06-18"<br> wms_timeitem "time"<br> wms_timedefault "2006-06-10"<br> wms_extent "-180.0 -90.0 180.0 102.96"
<br><br> END <br><br>MapSever connects to postgresql correctly.<br>My filter is translated to: <br><br>"date_trunc('day', time) = '2006-06-10'<br><br>When I run mapserver I get the following message:<br><br>content-type: application/vnd.ogc.se_xml
<br><br><?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?><br><!DOCTYPE ServiceExceptionReport SYSTEM "<a href="http://schemas.opengeospatial.net/wms/1.1.1/exception_1_1_1.dtd">
http://schemas.opengeospatial.net/wms/1.1.1/exception_1_1_1.dtd</a>"><br><ServiceExceptionReport version="1.1.1"><br><ServiceException><br>msDrawMap(): Image handling error. Failed to draw layer named 'AIRSRGB2'.
<br>prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT "time"::text,"location"::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from mapserver WHERE (date_trunc('day', time) = '2006-06-10') and (the_geom && setSRID( 'BOX3D(-
179.82 -89.91,179.82 89.91)'::BOX3D,find_srid('','mapserver','the_geom') ))'<br><br style="background-color: rgb(255, 255, 102);"><span style="background-color: rgb(255, 255, 102);">
Postgresql reports the error as 'ERROR: function date_trunc("unknown", character varying) does not exist</span><br style="background-color: rgb(255, 255, 102);"><span style="background-color: rgb(255, 255, 102);">
HINT: No function matches the given name and argument types. You may need to add explicit type casts.</span><br style="background-color: rgb(255, 255, 102);"><span style="background-color: rgb(255, 255, 102);">'</span>
<br><br>More Help:<br><br>Error with POSTGIS data variable. You specified 'check your .map file'.<br>Standard ways of specifiying are :<br>(1) 'geometry_column from geometry_table'<br>(2) 'geometry_column from (sub query) as foo using unique column name using SRID=srid#'
<br><br>Make sure you put in the 'using unique column name' and 'using SRID=#' clauses in.<br><br>For more help, please see <a href="http://postgis.refractions.net/documentation/">http://postgis.refractions.net/documentation/
</a><br><br>Mappostgis.c - version of Jan 23/2004.<br><br></ServiceException><br></ServiceExceptionReport><br><br>Regards,<br>Denis<br><br>