[mapserver-users] Problems with PostGIS connection pooling

Ludwig Kniprath ludwig at kni-online.de
Wed Apr 7 10:33:12 EDT 2010


Hello all,
I use mapserver 5.6.1 and php_mapscript (ms4w_3.0_beta10) on Apache and 
PHP 5.3.2 (CGI).

The spatial-data (OpenStreetMap) is stored in PostGIS.

The map-creation ist called by a php-script, which himself connects to a 
postgres database for administrative purposes.

In the map-File the PostGIS-Layers are defined with a different 
connection then the calling php-script, that seems to be the problem.

Although the Layer in the map-file is defined with
    CONNECTION "host=localhost dbname=osm user=max password=mustermann 
port=5432"
the logfile shows, that mapserver uses the connection-parameters from 
the calling php-script instead of the mapfile-parameters:
---snip---
[Wed Apr 07 15:53:48 2010].609000 msPostGISLayerOpen called: way from 
(select way,osm_id ,landuse, name from planet_osm_polygon where landuse 
is not null) as foo using unique osm_id using srid=4326
[Wed Apr 07 15:53:48 2010].609000 msPostGISLayerOpen: No connection in 
pool, creating a fresh one.
[Wed Apr 07 15:53:48 2010].687000 
msConnPoolRegister(landuse_layer1,user='kniprath' password='*******' 
dbname='wver_ims' host='127.0.0.1' port='5432',02BDFD18)
[Wed Apr 07 15:53:48 2010].687000 msPostGISLayerFreeItemInfo called.
[Wed Apr 07 15:53:48 2010].687000 msPostGISLayerGetItems called.
[Wed Apr 07 15:53:48 2010].687000 msPostGISParseData called.
[Wed Apr 07 15:53:48 2010].687000 msPostGISParseData: 
unique_column=osm_id, srid=4326, geom_column_name=way, 
table_name=(select way,osm_id ,landuse, name from planet_osm_polygon 
where landuse is not null) as foo
[Wed Apr 07 15:53:48 2010].687000 msPostGISLayerGetItems executing SQL: 
select * from (select way,osm_id ,landuse, name from planet_osm_polygon 
where landuse is not null) as foo where false limit 0
[Wed Apr 07 15:53:48 2010].703000 msPostGISLayerGetItems(): Query error. 
Error (FEHLER:  Relation »planet_osm_polygon« existiert nicht
LINE 1: ...ect * from (select way,osm_id ,landuse, name from planet_osm...
                                                             ^
) executing SQL: select * from (select way,osm_id ,landuse, name from 
planet_osm_polygon where landuse is not null) as foo where false limit 0
---snap---

These wrong connection-parameters cause the error, because in the 
queried database "wver_ims" the osm-tables don't exist.

Question:
Why doesn't mapserver connect to postgres with the 
mapfile-connection-parameters?

Thanks in advance!
Ludwig


More information about the mapserver-users mailing list