[Mapserver-users] error and mapserver+postgis demo
Ignacio Laplagne
laplagnegeo at softhome.net
Wed Mar 26 11:02:57 PST 2003
Dave,
Thanks for answering and my apology for the delay in answering again. We
were asking for some help regarding an error in the EXPLAIN VERBOSE
handling in mappostgis.c; actually we were doing further tests and at
the same time developing the application without the 'query'
functionality.
We've been trying to understand what this error might be about. We
concentrated on these lines of msPOSTGISLayerGetItems in mappostgis.c
---
// two cases here. One, its a table (use select * from table)
otherwise, just use the select clause
sprintf(sql,"EXPLAIN VERBOSE SELECT * FROM %s",table_name);
// this will call the postresql_NOTICE_HANDLER() callback!
layer->fields will be populated
query_result = PQexec(layerinfo->conn, sql );
[...]
---
We found part of a discussion between you and Sean Gilles about a patch
(http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0203/msg00311.
html), but this is dated March 2002, and the version of mappostgis.c we
have comes from mapserver 3.6.4 distribution, which incidentally seems
to be identical to the file coming with mapserver 3.6.5. Was this patch
you are talking about included in release 3.6.4?
We executed the command contained in the "sql" variable itself on
postgres (using psql, and starting the transaction and creating the
binary cursor just as done by mappostgis.c), and something strange
happened: the 'geometric column' comes out empty. If, on the other hand,
we add something to the sql statement to limit the number of records
(something like 'where gid=1') the geometry column comes out ok (right,
its content is binary but at least it has some content). So apparently
this is some kind of an error with postgis or postgresql, in any case,
since there should be no reason for the query to return an empty
geometry column.
We got stuck there and left the 'query' part suspended for the moment.
Any ideas?
Many thanks,
Ignacio
-----Mensaje original-----
De: David Blasby [mailto:dblasby at refractions.net]
Enviado el: miércoles, 19 de marzo de 2003 21:45
Para: Ignacio Laplagne
CC: mapserver-users
Asunto: Re: [Mapserver-users] error and mapserver+postgis demo
Ignacio Laplagne wrote:
>msPOSTGISLayerGetShape(): Query error. Error executing POSTGIS SQL
>statement (in FETCH ALL): EXPLAIN VERBOSE SELECT * FROM counties -
Error
>...
>
This is a problem with postgresql 7.3's handling of "EXPLAIN VERBOSE", I
thought I already fixed this problem (someone submitted a patch). Are
you using the most recent CVS version of mappostgis.c?
dave
More information about the MapServer-users
mailing list