[postgis] Connection problem

Nicolas Ribot nicol at ribot.com
Thu Feb 7 01:33:48 PST 2002


Hi Ross,

I had this kind of message some times ago: I could make direct queries, but
mapserver produces an error.

To track the error one step further, I copy/paste the SELECT part of the
error message generated by mapserver into the psql command line to see the
real DB error. Here it would be:
SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),oid::text
from hydro
WHERE the_geom && setSRID('BOX3D
  (147.346621621622-28.52,155.153378378378 -23.27)'::BOX3D,
  find_srid('','hydro','the_geom')
 );

The postgresql message is often more explicit than the mapserver one.

For me, it was a problem due to incompatible SRIDs: be sure that geometric
columns registered into the geometry_columns table have the right SRID.

Regards.
Nicolas.

Searle Ross wrote:

> I am having a problem getting postgis to return polygon data to
> mapserver. I have got postgis running in the configuration as per below.
> I can return point data no worries but when I try to view polygon info I
> get the following mapserver error :-
>
> msPOSTGISLayerWhichShapes(): Query error. Error executing POSTGIS SQL
> statement (in FETCH ALL): DECLARE mycursor BINARY CURSOR FOR SELECT
> asbinary(force_collection(force_2d(the_geom)),'NDR'),oid::text from
> hydro WHERE the_geom && setSRID('BOX3D(147.346621621622
> -28.52,155.153378378378 -23.27)'::BOX3D,
> find_srid('','hydro','the_geom') )
>
> The postmaster also logs the following message at the same time
>
> pq_flush: send() failed: Connection reset by peer
> pq_flush: send() failed: Connection reset by peer
> pq_flush: send() failed: Connection reset by peer
> pq_flush: send() failed: Connection reset by peer
> pq_flush: send() failed: Connection reset by peer
> pq_flush: send() failed: Connection reset by peer
> pq_flush: send() failed: Connection reset by peer
> pq_flush: send() failed: Connection reset by peer
> pq_flush: send() failed: Connection reset by peer
> pq_recvbuf: recv() failed: Connection reset by peer
>
> The fetch statement appears to run OK in the psql client. ie it fetchs
> some records.
>
> Anyone got any ideas
>
> Thanks
> Ross
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20020207/dd8e1343/attachment.html>


More information about the postgis-users mailing list