[mapserver-users] msPOSTGISLayerGetShape(): Error
Paul Moen
pmoen at nd.gov
Fri Feb 29 07:27:20 PST 2008
Thanks Regina and Colin for the replies. I was hoping that I wasn't
imagining things. I will just add the cast until I install PosgreSQL 8.3.
Paul
On 2/29/08 7:54 AM, "Obe, Regina" <robe.dnd at cityofboston.gov> wrote:
> Actually I remember yeh back there was an automatic boolean cast put in
>
> the lwpostgis.sql. I think it was later removed because it was felt
>
> doing such things in Postgis was stepping out of bounds since that cast
>
> really has nothing to do with postgis and there is no internal
>
> dependency on it.
>
>
>
> Here is a thread about the issue
>
> http://postgis.refractions.net/pipermail/postgis-users/2007-October/0174
>
> 52.html
>
>
>
> I suspect maybe its because you are running a newer version of PostGIS
>
> (that I think has the cast removed where the cast was removed) not
>
> PostgreSQL that you are experiencing it.
>
>
>
> Hope that Helps,
>
> Regina
>
>
>
>
>
> -----Original Message-----
>
> From: mapserver-users-bounces at lists.osgeo.org
>
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Paul Moen
>
> Sent: Thursday, February 28, 2008 4:08 PM
>
> To: mapserver-users at lists.osgeo.org
>
> Subject: [mapserver-users] msPOSTGISLayerGetShape(): Error
>
>
>
> I just upgraded to postgres 8.2.6
>
>
>
> And postgis 1.3.2("POSTGIS="1.3.2" GEOS="3.0.0rc4-CAPI-1.3.3" PROJ="Rel.
>
> 4.6.0, 21 Dec 2007" USE_STATS") and I get the following error.
>
>
>
> PHP Fatal error: [MapServer Error]: msPOSTGISLayerGetShape(): Error
>
> executing POSTGIS SQL statement (in FETCH ALL): DECLARE mycursor2 BINARY
>
> CURSOR FOR SELECT
>
> "site_id"::text,"location"::text,"longitude"::text,"latitude"::text,"cou
>
> nty"
>
> ::text,"status"::text,"arb_siteno"::text,"last_name"::text,"first_name":
>
> :tex
>
> t,"add1"::text,"add2"::text,"city"::text,"state"::text,"zip"::text,"phon
>
> e"::
>
> text,"remarks"::text,"password"::text,"email"::text,"online_reporting"::
>
> text
>
> ,"x_coord"::text,"y_coord"::text,asbinary(force_collection(force_2d(geom
>
> )),'
>
> NDR') from station WHERE site_id = 4243
>
> -ERROR: cannot cast type boolean to text, referer: http://10.8.54.31/
>
> : ..."::text,"latitude"::text,"county"::text,"status"::text,"arb_...,
>
> ^,
>
>
>
> My table in postgresql is
>
>
>
> CREATE TABLE station
>
> (
>
>
>
> site_id integer NOT NULL DEFAULT 0,
>
> "location" character varying(14) NOT NULL DEFAULT '',
>
> longitude double precision NOT NULL DEFAULT 0,
>
> latitude double precision NOT NULL DEFAULT 0,
>
> county character varying(30) NOT NULL DEFAULT '',
>
> status boolean NOT NULL DEFAULT false,
>
> arb_siteno character varying(5) NOT NULL DEFAULT '',
>
> last_name character varying(35) NOT NULL DEFAULT '',
>
> first_name character varying(20) NOT NULL DEFAULT '',
>
> add1 character varying(21) NOT NULL DEFAULT '',
>
>
>
> add2 character varying(21) NOT NULL DEFAULT '',
>
> city character varying(20) NOT NULL DEFAULT '',
>
> state character varying(2) NOT NULL DEFAULT '',
>
> zip character varying(9) NOT NULL DEFAULT '',
>
> phone character varying(10) NOT NULL DEFAULT '',
>
> remarks text NOT NULL DEFAULT '',
>
> "password" character varying(20) NOT NULL DEFAULT '',
>
> email character varying(80) NOT NULL DEFAULT '',
>
> online_reporting boolean NOT NULL DEFAULT false,
>
> x_coord integer NOT NULL DEFAULT 0,
>
> y_coord integer NOT NULL DEFAULT 0,
>
> geom geometry,
>
> )
>
>
>
> My mapscript version is
>
>
>
> MapServer Version MapServer version 5.0.2 OUTPUT=GIF OUTPUT=PNG
>
> OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
>
> SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
>
> SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
>
> SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=EPPL7
>
> INPUT=POSTGIS
>
> INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>
> PHP MapScript Version ($Revision: 7251 $ $Date: 2008-01-08 09:04:53
>
> -0800
>
> (Tue, 08 Jan 2008) $)
>
>
>
> All running on Mac OS 10.5.
>
>
>
> msPOSTGISLayerGetShape() tries to cast the status column to text, did it
>
> always do that?
>
>
>
> PostgreSQL 8.3 will have a type cast from boolean to text. But none of
>
> the
>
> earlier versions were supposed to.
>
>
>
> I can run the sql
>
> SELECT status::text from station
>
> with no errors in PostgreSQL 8.2.4 but not in 8.2.5 or 8.2.6, which
>
> leads me
>
> to believe that there was in a cast from boolean to text in 8.2.4.
>
>
>
> I never added a custom cast to do this before, so I am wondering if the
>
> only
>
> thing that changed is PostgreSQL? Can anyone confirm that there was a
>
> cast
>
> for boolean to text in PostgreSQL 8.2.4?
>
>
>
> Thanks,
>
>
>
> Paul
>
>
>
> _______________________________________________
>
> mapserver-users mailing list
>
> mapserver-users at lists.osgeo.org
>
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
> -----------------------------------------
>
> The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure
> pursuant to Massachusetts law. It is intended
>
> solely for the addressee. If you received this in error, please
> contact the sender and delete the material from any computer.
>
>
More information about the MapServer-users
mailing list