[Mapserver-users] query postgis layer (boolean conversion problem)

David Blasby dblasby at refractions.net
Mon Jul 7 12:38:50 EDT 2003


No, this is a bug with postgresql - they dont have a default 
boolean->text type cast.

If you're using 7.2, add this function:

CREATE FUNCTION text(bool) returns text as 'SELECT ''t'' WHERE $1 UNION
SELECT ''f'' WHERE NOT $1' language 'SQL' with (iscachable,isstrict);


On 7.3 (and 7.4), you'll ALSO have to add:

CREATE CAST (boolean AS text) WITH FUNCTION text(bool) AS IMPLICIT;





More information about the mapserver-users mailing list