[mapserver-users] Postgres SQL oddity . . .

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Mon Dec 15 13:47:49 PST 2014


I'm trying to display a set of GPS points from a layer in Postrgres . . .

Getting this error however:

<ServiceExceptionReport version="1.3.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd"><ServiceException>
msDrawMap(): Image handling error. Failed to draw layer named 'AVL_Plot_00to96'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  column reference "vname" is ambiguous
LINE 1: select "elapsed_min","vname",encode(ST_AsBinary(ST_Force2D("...

</ServiceException></ServiceExceptionReport>

from this Call:

DATA "the_geom from (

                        select
                                distinct on (vname) vname,
                                st_length(st_transform(the_line, 26993)) as feet,
                                (DATE_PART('day', now() - acqtime) * 24 +
                                        DATE_PART('hour', now() - acqtime) * 60 +
                                        DATE_PART('minute', now() - acqtime)
                                        ) as elapsed_min,  -- Compiled minutes since last major move of asset.
                                *
                        from
                                loc
                        where
                                st_length(st_transform(the_line, 26993)) > 30  -- GPS error
                        order by
                                vname desc

                                        ) as subquery using unique vname using srid=200068"

What I don't understand is how VNAME can be ambiguous when calling only one table (loc)??  The SQL works fine in PGADMIN.   Does the using unique vname have something to do with the problem, which seems to be required.

Help??

Thanks.

bobb


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20141215/77a01fcf/attachment.htm>


More information about the MapServer-users mailing list