[postgis-users] Mapserv Issues
Zamil Murji
Zamil.Murji at divestco.com
Mon May 17 10:24:40 PDT 2004
Sorry,
the first one doesn't work, but the second one does! YES! Thanks a whole lot
Maybe this could make it into the mapserver 4.2 beta 3 release?
Just to recap
sprintf(sql,"SELECT * FROM %s WHERE false LIMIT 0",table_name); worked but
sprintf(sql,"SELECT * FROM (%s) WHERE false LIMIT 0",table_name); did not
Thanks
Zamil
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of Zamil
Murji
Sent: Monday, May 17, 2004 11:19 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] Mapserv Issues
Thanks Dave
Either way produces the same error
msPOSTGISLayerGetItems(): Query error. Error executing POSTGIS SQL statement (in msPOSTGISLayerGetItems): SELECT * FROM (select
oid, to_date(main_well1.spud_date, 'YYYY-MM-DD') as pretty_spud_date, to_date(main_well1.rig_release_date, 'YYYY-MM-DD') as prett
y_rig_release_date, * from main_well1) as new_table false LIMIT 0
-ERROR: parser: parse error at or near "false" at character 204
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of David
Blasby
Sent: Monday, May 17, 2004 10:58 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Mapserv Issues
Zamil Murji wrote:
> Ok, after doing some more research, I have found my bottleneck. Inside mappostgis.c there is a function called msPOSTGISLayerGetItems. This function formats a query:
> sprintf(sql,"SELECT * FROM %s LIMIT 0",table_name); // attempt the query, but dont actually do much (this might take sometime if there is an order by!)
I thought this might cause a slowdown (hence the comment).
Try changing the line to:
sprintf(sql,"SELECT * FROM (%s) WHERE false LIMIT 0",table_name);
or
sprintf(sql,"SELECT * FROM %s WHERE false LIMIT 0",table_name);
The SQL parser should notice that this will not return any rows and just
return the schema.
dave
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list