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 &#39;AIRSRGB2&#39;.
<br>prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: &#39;DECLARE mycursor BINARY CURSOR FOR SELECT &quot;time&quot;::text,&quot;location&quot;::text,asbinary(force_collection(force_2d(the_geom)),&#39;NDR&#39;),gid::text from mapserver WHERE (date_trunc(&#39;day&#39;, time) = &#39;2006-06-10&#39;) and (the_geom &amp;&amp; setSRID( &#39;BOX3D(-
179.82 -89.91,179.82 89.91)&#39;::BOX3D,find_srid(&#39;&#39;,&#39;mapserver&#39;,&#39;the_geom&#39;) ))&#39;<br><br style="background-color: rgb(255, 255, 102);"><span style="background-color: rgb(255, 255, 102);">
Postgresql reports the error as &#39;ERROR:  function date_trunc(&quot;unknown&quot;, 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);">&#39;</span>
<br><br>More Help:<br><br>Error with POSTGIS data variable. You specified &#39;check your .map file&#39;.<br>Standard ways of specifiying are :<br>(1) &#39;geometry_column from geometry_table&#39;<br>(2) &#39;geometry_column from (sub query) as foo using unique column name using SRID=srid#&#39;
<br><br>Make sure you put in the &#39;using unique  column name&#39; and &#39;using SRID=#&#39; 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>