[Qgis-developer] 2.6 strange behaviour with editing boolean field using checkbox + postgis

Rémi Cura remi.cura at gmail.com
Fri Aug 28 06:11:25 PDT 2015


Hey,
some strange behaviour here (2.6) :

In a postgis layer over a postgis view
one of the view field is a boolean

I chose the checkbox for editing this field.
checked is "true", unchecked is "false" , without the quote signs.

When adding a new geometry, all works as intended, the row inserted into
the database is the correct one.

But when trying to get info about the geometry (arrow with the question
mark), it generates an error :

1 cursor states lost.

SQL:

DECLARE qgis_12 BINARY CURSOR FOR

SELECT st_asbinary("geom",'NDR')

   ,boolout("positionning_absolute")

   ,"gid"::text

   ,"type"::text

   ,"positionning_offset_type"::text

   ,"positionning_offset"::text

   ,"positionning_orientation_type"::text

   ,"positionning_orientation"::text

   ,"curv_dist"::text

FROM "street_amp"."editing_street_object"

WHERE boolout("positionning_absolute")='t'


Résultat: 7 (

ERROR: operator does not exist: cstring = unknown

LINE 1: ...ng_street_object" WHERE boolout("positionning_absolute")='t'

^

HINT: No operator matches the given name and argument type(s). You might
need to add explicit type casts.

)


I don't understand the need to use the boolout function,

it works simply without it, and if you want to be extra sure,

you could cast the text to boolean safely (it is not necessary tough)


FROM "street_amp"."editing_street_object"

WHERE "positionning_absolute"='t'::boolean


Cheers,

Rémi-C
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150828/2e2440fe/attachment.html>


More information about the Qgis-developer mailing list