Hi,<br><br>I have created a database on PostgreSQL version 8.0.3.&nbsp; I have translated my shapefile to an sql file using shp2pgsql version 1.1.2 from PostGIS.&nbsp; 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>&nbsp;&nbsp;&nbsp; METADATA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wms_title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;denis&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wms_timeextent&nbsp; &quot;2006-01-01/2006-06-18&quot;<br>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; wms_timeitem&nbsp;&nbsp;&nbsp; &quot;time&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; wms_timedefault &quot;2006-06-10&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wms_extent&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;-180.0 -90.0 180.0 102.96&quot;
<br><br>&nbsp;&nbsp;&nbsp; END&nbsp; <br><br>MapSever connects to&nbsp; postgresql correctly.<br>My filter is translated to: <br><br>&quot;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>&lt;?xml version='1.0' encoding=&quot;ISO-8859-1&quot; standalone=&quot;no&quot; ?&gt;<br>&lt;!DOCTYPE ServiceExceptionReport SYSTEM &quot;<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>&quot;&gt;<br>&lt;ServiceExceptionReport version=&quot;1.1.1&quot;&gt;<br>&lt;ServiceException&gt;<br>msDrawMap(): Image handling error. Failed to draw layer named &amp;#39;AIRSRGB2&amp;#39;.
<br>prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: &amp;#39;DECLARE mycursor BINARY CURSOR FOR SELECT &amp;quot;time&amp;quot;::text,&amp;quot;location&amp;quot;::text,asbinary(force_collection(force_2d(the_geom)),&amp;#39;NDR&amp;#39;),gid::text from mapserver WHERE (date_trunc(&amp;#39;day&amp;#39;, time) = &amp;#39;2006-06-10&amp;#39;) and (the_geom &amp;amp;&amp;amp; setSRID( &amp;#39;BOX3D(-
179.82 -89.91,179.82 89.91)&amp;#39;::BOX3D,find_srid(&amp;#39;&amp;#39;,&amp;#39;mapserver&amp;#39;,&amp;#39;the_geom&amp;#39;) ))&amp;#39;<br><br style="background-color: rgb(255, 255, 102);"><span style="background-color: rgb(255, 255, 102);">
Postgresql reports the error as &amp;#39;ERROR:&nbsp; function date_trunc(&amp;quot;unknown&amp;quot;, character varying) does not exist</span><br style="background-color: rgb(255, 255, 102);"><span style="background-color: rgb(255, 255, 102);">
HINT:&nbsp; 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);">&amp;#39;</span>
<br><br>More Help:<br><br>Error with POSTGIS data variable. You specified &amp;#39;check your .map file&amp;#39;.<br>Standard ways of specifiying are :<br>(1) &amp;#39;geometry_column from geometry_table&amp;#39;<br>(2) &amp;#39;geometry_column from (sub query) as foo using unique column name using SRID=srid#&amp;#39;
<br><br>Make sure you put in the &amp;#39;using unique&nbsp; column name&amp;#39; and &amp;#39;using SRID=#&amp;#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>&lt;/ServiceException&gt;<br>&lt;/ServiceExceptionReport&gt;<br><br>Regards,<br>Denis<br><br>