[Mapserver-users] USING UNIQUE and USING SRID=# not recognized

Uli Mueller uli.mueller at gmx.ch
Thu Apr 3 10:40:01 EST 2003


Hi

USING UNIQUE and USING SRID=# are not recognized in MapServer.

I have several mapfiles with PostGIS-layers. They all work fine as long as
MapServer can find the oid-column automatically and I don't need an explicit
USING... statement.

Example:
The follwoing line in my mapfile is ok:
DATA "the_geom from (select t1.oid, t2.count AS NCASES, t2.countlast AS
NCASESLAST,t2.caseyear AS YEAR, * from t_dam_casept t1 LEFT JOIN
t_dam_casecount t2 ON t1.id=t2.id WHERE t1.art='Sheep') AS foo"

Adding "USING UNIQUE oid" and/or "USING SRID=21781"  gives me the following
error:
msPOSTGISLayerWhichShapes(): Query error. prep_DB:Error executing POSTGIS
DECLARE statement (0.6 failed - retried 0.5 and it failed too). DECLARE
mycursor BINARY CURSOR FOR SELECT
NCASES::text,NCASESLAST::text,asbinary(force_collection(force_2d(the_geom)),
'NDR'),OID::text from (select t1.oid, t2.count AS NCASES, t2.countlast AS
NCASESLAST,t2.caseyear AS YEAR, * from t_dam_casept t1 LEFT JOIN
t_dam_casecount t2 ON t1.id=t2.id WHERE t1.art='Sheep') AS foo USING UNIQUE
oid USING SRID=21781 WHERE (YEAR = '2002') and (the_geom && setSRID(
'BOX3D(584638.311775 222602.950312,607674.688225
244334.049688)'::BOX3D,find_srid('','t_dam_casept','the_geom') ))

I tried to paste the select-statement from above into psql and there I also
get an error:
ERROR:  parser: parse error at or near "USING" at character 286

The relevant tables exist and have primary keys on the oid-fields. User
permissions are set at least to SELECT for all relevant tables.

My configuration:
Suse Linux 7.1
PostgreSQL 7.3.1
postgis-0.7.4
MapServer version 3.6.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Thank you for answers!

Uli




More information about the mapserver-users mailing list