Ticket #1647 (closed defect: wontfix)

Opened 7 years ago

Last modified 5 years ago

Postgis- cursor "mycursor" already exists in mapserver 4.8.1 ok in 4.6.1

Reported by: bengt.nilsson@… Owned by: refractions
Priority: high Milestone:
Component: PostGIS Interface Version: 4.8
Severity: critical Keywords:
Cc: mark@…

Description

Hi,
I am using postgresql-8.0.3 and postgis-1.0.4. Requesting more than one layer 
in Mapserver 4.8.1 I get :
'<?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;k92_strandlinje&#39;.
prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual 
query) statement: &#39;DECLARE mycursor BINARY CURSOR FOR SELECT asbinary
(force_collection(force_2d(the_geom)),&#39;NDR&#39;),gid::text from 
k92_strandlin_polygon WHERE the_geom &amp;&amp; setSRID(&#39;BOX3D
(10.202777506987 55.5016934171322,12.9972224354854 57.798407114202)
&#39;::BOX3D, 4326 )&#39; &lt;br&gt;&lt;br&gt;

Postgresql reports the error as &#39;ERROR:  cursor &quot;mycursor&quot; 
already exists
&#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/ 

&lt;br&gt;&lt;br&gt;Mappostgis.c - version of Jan 23/2004.

</ServiceException>
</ServiceExceptionReport>'

In Mapserver 4.6.1 it works. 

/Regards Bengt

Change History

Changed 7 years ago by sdlime

  • owner changed from sdlime to refractions
  • component changed from MapServer CGI to PostGIS Interface
Moving to PostGIS interface...

Steve

Changed 7 years ago by mark@…

  • cc mark@… added
I'm unable to replicate this.  
Can you supply a test mapfile and data?

Changed 7 years ago by mapserver@…

Hi,
I encountered this bug too. If a do a queryByPoint() on a layer that is not the 
lowest in the drawing order and then call drawQuery(), I got the 
cursor "mycursor" already exists error.
If, instead, the layer _is_ the lowest in the drawing order (the first to be 
drawn), everythnig works as a charm.
This applies, obviously, only to PostGIS layer.
And it happens _only_ if QUERYMAP has STYLE HILITE, 
using STYLE SELECTED, it works.
I'm using ms4w version 1.5.1 through Java MapScript against PostgreSQL 8.1.3 on 
SuSE Linux 9.0 and PostGIS 1.1.2 

Bye
Paolo Rizzi

Changed 5 years ago by pramsey

  • status changed from new to closed
  • resolution set to wontfix

New driver should not exhibit this behavior anymore (mapserver 5.4+)

Note: See TracTickets for help on using tickets.