[Qgis-user] [Possible bug] Qgis treating uuid as text in db views
Rémi Desgrange
Remi.Desgrange at fibrea.net
Wed Sep 19 07:07:32 PDT 2018
Error from the db :
When the linestring is cut:
Erroneous query: SELECT "tab_id"::text FROM (SELECT DISTINCT "expl_id" FROM "projet"."v_example" WHERE "expl_id" ILIKE '%97b99098-3807-4d5f-97e9-c58bfff18f68%' ORDER BY "expl_id") foo returned 7 [ERREUR: l'opérateur n'existe pas : uuid ~~* unknown
LINE 1: ...expl_id" FROM "projet"."v_example" WHERE "expl_id" ILIKE '%97...
And when you try to save:
(sorry in French) ERREUR: syntaxe en entrée invalide pour le type uuid : « e5e03331-74cf-4077-92b2-6f93c98c57f6_1 »
which should translate to « invalid input syntax from uuid type ».
I should mention clearly (if it was not in my first mail) that I tried multiple strategies about widget type in attributes form (text, uuid generator) with both default value and non-default value (expl_id is autogenerated via a default constraint in PG).
The thing that really bother me is that it works all fine with the table but not with the view.
Cheers, Rémi Desgrange
Le 19/09/2018 15:22, « Qgis-user au nom de Bernhard Ströbl » <qgis-user-bounces at lists.osgeo.org au nom de bernhard.stroebl at jena.de> a écrit :
Am 19.09.2018 um 11:26 schrieb Rémi Desgrange:
> Hi,
>
> I have some database view used in qgis. (from postgresql 10, postgis2.4). Since some time now (I posted a bug report 3 months ago here: https://issues.qgis.org/issues/19180) This was about errors in my DBs log about selection request that does not end well. But, at this time it was not a problem for the end user. Yesterday, we spotted a much more problematic error. Here is the story:
>
> We wanted to cut a linestring, so we use the tool “Split Features”. And when we did that. It cut the linestring, so changing the geometry of the linestring (updating) and trying to create a new one with the other part. The problem is: it updated correctly the existing feature, but did _not_ save the other one (it created it in qgis though).
Was there any error message from the DB?
> The reason behind this is qgis treating an uuid like a text field. So, when treating uuid as text, when it tries to create a new feature out of the old one split, it put the value <old_uuid>_1 which cannot work obviously.
It is the user's obligation to fill meaningful values in fields. This is
e.g. also true for integer primary key fields: if you fill in a value
already present or no value at all the changes cannot be saved.
I would create an insert trigger on the DB that creates a uuid for any
insert request.
Hope this hleps
Bernhard
>
> This is not a problem with form or style, the field as the type uuid in qgis, I “mapped” uuid generator on it, and tried text editor too.
>
>
> I don’t know if it’s us that don’t know how to properly configure Qgis or if it’s a bug…
>
>
> Cordialement, Rémi Desgrange
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
__________ Information from ESET Mail Security, version of virus signature database 18077 (20180919) __________
The message was checked by ESET Mail Security.
http://www.eset.com
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
More information about the Qgis-user
mailing list