PostGIS Connection Trouble

Steven Monai stevem at SPATIALMAPPING.COM
Thu Jan 20 12:38:38 EST 2005


Whoops, guess I should be a little more observant. You're using a recent
version of MapServer. Is it possible that the PostGIS-keyword-case bug is
still alive?

-Steve M.
--



On Wed, 19 Jan 2005 18:05:19 +0100, Arnulf Christl
<arnulf.christl at CCGIS.DE> wrote:

>Hi,
>I am at a loss, we use MapServer/PostGIS every day but this one wont work.
>
>PostgreSQL 7.4.2
>PostGIS 0.9.0
>SuSE Linux Enterprise Server 9
>
><!-- MapServer version 4.4.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
>SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
>SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
>INPUT=POSTGIS INPUT=ORACLESPATIAL INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->
>
>The error message looks strange to me, never saw that one. Especially
>the part:
>"oid::text from WHERE &amp;&amp;"
>Anybody any idea? See the MAP-file DATA string at the bottom.
>
>###
><?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
><!DOCTYPE ServiceExceptionReport SYSTEM
>"http://schemas.opengeospatial.net/wms/1.1.1/exception_1_1_1.dtd">
><ServiceExceptionReport version="1.1.1">
><ServiceException>
>msDrawMap(): Image handling error. Failed to draw layer named
>&#39;poly&#39;.
>prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual
>query) statement: &#39;DECLARE mycursor BINARY CURSOR FOR SELECT
>asbinary(force_collection(force_2d()),&#39;NDR&#39;),oid::text from
>WHERE &amp;&amp; setSRID(&#39;BOX3D(3275833.33333155
>5400833.33332511,3524166.66666667 5649166.66666667)&#39;::BOX3D,
>find_srid(&#39;&#39;,&#39;&#39;,&#39;&#39;) )&#39; &lt;br&gt;&lt;br&gt;
>
>Postgresql reports the error as &#39;FEHLER: Fehler »syntax error« bei
>»WHERE« at character 104
>&#39;&lt;br&gt;&lt;br&gt;
>
>More Help:&lt;br&gt;&lt;br&gt;
>
>Error with POSTGIS data variable. You specified &#39;&amp;lt;check your
>.map file&amp;gt;&#39;.&lt;br&gt;
>
>Standard ways of specifiying are : &lt;br&gt;
>(1) &#39;geometry_column from geometry_table&#39; &lt;br&gt;
>(2) &#39;geometry_column from (&amp;lt;sub query&amp;gt;) as foo using
>unique &amp;lt;column name&amp;gt; using SRID=&amp;lt;srid#&amp;gt;&#39;
>&lt;br&gt;&lt;br&gt;
>
>Make sure you put in the &#39;using unique &amp;lt;column
>name&amp;gt;&#39; and &#39;using SRID=#&#39; clauses in.
>
>&lt;br&gt;&lt;br&gt;For more help, please see
>http://postgis.refractions.net/documentation.php
>
>&lt;br&gt;&lt;br&gt;Mappostgis.c - version of Jan 23/2004.
>
>msPOSTGISLayerParseData(): Query error. Error parsing POSTGIS data
>variable. Must contain &#39;geometry_column from table_name&#39; or
>&#39;geom from (subselect) as foo&#39; (couldnt find &#39; from &#39;).
>More help: &lt;br&gt;&lt;br&gt;
>
>Error with POSTGIS data variable. You specified &#39;SELECT the_geom
>FROM (SELECT the_geom AS the_geom, betrnr AS betrnr, jahr AS jahr, oid
>AS oid FROM user_polygon) AS foo USING UNIQUE oid
SRID=31467&#39;.&lt;br&gt;
>Standard ways of specifiying are : &lt;br&gt;
>(1) &#39;geometry_column from geometry_table&#39; &lt;br&gt;
>(2) &#39;geometry_column from (&amp;lt;sub query&amp;gt;) as foo using
>unique &amp;lt;column name&amp;gt; using SRID=&amp;lt;srid#&amp;gt;&#39;
>&lt;br&gt;&lt;br&gt;
>
>Make sure you put in the &#39;using unique &amp;lt;column
>name&amp;gt;&#39; and &#39;using SRID=#&#39; clauses in.
>
>&lt;br&gt;&lt;br&gt;For more help, please see
>http://postgis.refractions.net/documentation.php
>
>&lt;br&gt;&lt;br&gt;Mappostgis.c - version of Jan 23/2004.
>
></ServiceException>
>
></ServiceExceptionReport>
>###
>
>The history of my helplessness from bottom to top. We've tried the
>SELECTS with capitals, repeated uses of 'USING' etc. wont work.
>
>DATA "SELECT the_geom FROM (SELECT the_geom AS the_geom, betrnr AS
>betrnr, jahr AS jahr, oid AS oid FROM user_polygon) AS foo USING UNIQUE
>user_polygon.oid USING SRID=31467"
>
># DATA "the_geom FROM (SELECT the_geom AS the_geom, betrnr AS betrnr,
>jahr AS jahr, oid AS oid FROM user_polygon) AS foo USING UNIQUE oid
>USING SRID=31467"
>
># DATA "SELECT the_geom FROM (SELECT the_geom AS the_geom, betrnr AS
>betrnr, jahr AS jahr, oid AS oid FROM user_polygon) AS foo USING UNIQUE
>oid USING SRID=31467;"
>
># DATA "SELECT the_geom FROM (SELECT the_geom AS the_geom, betrnr AS
>betrnr, jahr AS jahr, oid AS oid FROM user_polygon) AS foo USING UNIQUE
>oid USING SRID=31467"
>
># DATA "the_geom FROM (SELECT the_geom AS the_geom, betrnr AS betrnr,
>jahr AS jahr, oid AS oid FROM user_polygon) as foo using unique oid
>using SRID=31467"
>
># DATA 'the_geom FROM (SELECT betrnr, jahr FROM user_polygon) AS foo
>USING UNIQUE SRID=31467'
>
># DATA "the_geom FROM user_polygon"
>
>
>Best regards,
>Arnulf.



More information about the mapserver-users mailing list