[mapserver-users] Mapserver 5 migration & PostGIS
Paul Ramsey
pramsey at cleverelephant.ca
Fri Jul 4 15:57:09 PDT 2008
Does your points table not have a primary key? Probably it's related
to the primary key inference code, but don't quote me. If it *does*
have a primary key, add a USING UNIQUE clause to your DATA.
P
On Fri, Jul 4, 2008 at 2:57 PM, Ben Brehmer <bbrehmer at refractions.net> wrote:
> Dear All,
>
> I'm just in the process of changing all of my mapfiles to be 5.x compatible.
>
> The PostGIS layer[1] which worked fine with 4.6 now throws an odd error [2]
> in 5.0.3. If you look at the error, you will notice that the query has
> ""::text prepended to it although this is not in the DATA statement. It
> deosn't seem to matter how I manipulate the DATA statement, it always has an
> empty string prepended to it at runtime which causes this error.
>
> Any ideas why an empty string is prepended to a PostGIS query at runtime in
> Mapserver 5?
>
> Thanks,
>
> Ben Brehmer
>
>
>
> [1]
> LAYER
> NAME "pointlayer"
> DATA "the_geom FROM points"
> CONNECTIONTYPE postgis
> CONNECTION "host=localhost user=postgres port=5432 dbname=xxx password=xxx"
>
> ...
> ..
> .
>
>
> [2]
> msDrawMap(): Image handling error. Failed to draw layer named 'pointlayer'.
> prepare_database(): Query error. Error declaring cursor: ERROR: zero-length
> delimited identifier at or near """" at character 43 With query string:
> DECLARE mycursor BINARY CURSOR FOR SELECT
> ""::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from
> points WHERE the_geom && setSRID('BOX3D(-13692533.9246539
> 5944251.98072804,-13537311.7862516 6063067.47212323)'::BOX3D,
> find_srid('','points','the_geom') )
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list