<div>Valeria:</div>
<div>&nbsp;</div>
<div>I think the problem is that your data statment is incomplete. You should write something like:</div>
<div>DATA: &quot;the_geom from chile_comuna <span lang="ES-MX">as foo using unique &lt;unique column name&gt; using srid=&lt;yourSRID&gt;&quot;</span></div>
<div><span lang="ES-MX">Hope it helps,</span></div>
<div><span lang="ES-MX"></span>&nbsp;</div>
<div><span lang="ES-MX">Saludos</span></div>
<div><span lang="ES-MX">Luis</span></div>
<div><span lang="ES-MX"></span>&nbsp;</div>
<div><br><br></div>
<div class="gmail_quote">2009/1/12 Valeria Muņoz <span dir="ltr">&lt;<a href="mailto:valemunoz@gmail.com">valemunoz@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>HI</div>
<div>&nbsp;</div>
<div>&nbsp; I am trying to connect postgres with my Mapfile, but I get the following error:</div>
<div>&nbsp;</div>
<div>msDrawMap(): Image handling error. Failed to draw layer named &#39;chile_comuna&#39;. prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: &#39;DECLARE mycursor BINARY CURSOR FOR SELECT &quot;NAME&quot;::text,asbinary(force_collection(force_2d(the_geom)),&#39;NDR&#39;),gid::text from chile_comuna WHERE the_geom &amp;&amp; setSRID(&#39;BOX3D(-71.2556639435156 -29.9271886101172,-71.2540857172265 -29.9256103838281)&#39;::BOX3D, find_srid(&#39;&#39;,&#39;chile_comuna&#39;,&#39;the_geom&#39;) )&#39; Postgresql reports the error as &#39;ERROR: column &quot;NAME&quot; does not exist LINE 1: DECLARE mycursor BINARY CURSOR FOR SELECT &quot;NAME&quot;::text,asbin... ^ &#39; More Help: Error with POSTGIS data variable. You specified &#39;check your .map file&#39;. Standard ways of specifiying are : (1) &#39;geometry_column from geometry_table&#39; (2) &#39;geometry_column from (sub query) as foo using unique column name using SRID=srid#&#39; Make sure you put in the &#39;using unique column name&#39; and &#39;using SRID=#&#39; clauses in. For more help, please see <a href="http://postgis.refractions.net/documentation/" target="_blank">http://postgis.refractions.net/documentation/</a> Mappostgis.c - version of Jan 23/2004. </div>

<div>&nbsp;</div>
<div>
<div dir="ltr" style="TEXT-ALIGN: left">I use the command shp2pgsql to pass the information of the shapefile to postgres table.</div>
<div dir="ltr" style="TEXT-ALIGN: left">&nbsp;</div>
<div dir="ltr" style="TEXT-ALIGN: left">MapFile</div>
<div dir="ltr" style="TEXT-ALIGN: left">&nbsp;LAYER<br>&nbsp;&nbsp;&nbsp; NAME &#39;chile_comuna&#39;<br>&nbsp;&nbsp;&nbsp; TYPE POLYGON&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #DATA &#39;chile_comuna.shp&#39;<br>&nbsp;&nbsp;&nbsp; CONNECTIONTYPE postgis<br>&nbsp;&nbsp;CONNECTION &quot;user=postgres password=1234 dbname=geo_referencia host=localhost&quot;<br>
&nbsp;&nbsp;DATA &quot;the_geom from chile_comuna&quot;<br>.....</div>
<div dir="ltr" style="TEXT-ALIGN: left">&nbsp;</div>
<div dir="ltr" style="TEXT-ALIGN: left">
<div dir="ltr" style="TEXT-ALIGN: left">can anyone help me? pleasee...</div>
<div dir="ltr" style="TEXT-ALIGN: left">rgs</div></div></div><br>_______________________________________________<br>mapserver-users mailing list<br><a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br><br></blockquote></div><br>