I made a processing model in QGIS 3.10 where I calculated a integer value "mycolumn". Within the model, I refactored the "mycolumn" value to Boolean using mycolumn >= 1
. As I expected, the output layer had a boolean
field named "mycolumn". I copied the output layer's features to a PostGIS layer with the same setup (Boolean field named "mycolumn"). In the test case, all entries in "mycolumn" were false. When saving the layer, PostGIS throws the exception
PostGIS error while adding features: ERROR: column "mycolumn" is of type boolean but expression is of type integer LINE 1: ...S (st_geomfromwkb($1::bytea,2056),$2,528,$3,$4,$5,0,'',$6) R... ^ HINT: You will need to rewrite or cast the expression.
However, The "0" after $5 is in the position I would expect "mycolumn" to be in. Thus, I would expect the expression to be st_geomfromwkb($1::bytea,2056),$2,528,$3,$4,$5,$6,'',$7)
. Is this a bug and is there a workaround?