Bug report #21310

JSON column from a Postgresql Database is working to read information, but when editing the column and saving it, an error occurs

Added by Felipe Souza over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/PostGIS
Affected QGIS version:3.4.4 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:29128

Description

The error seems to occur when saving from qgis back to Postgresql.

I´m connecting to a Postgresql Database, opening a table that has a json field. I see the data, and I´m trying to add an extra letter to a field. (attachment print).

The way I see, it seems that QGIS is sending back data as "hstore", but the column from my table is json.

ERROR ALERT:
Error PostGIS when changing attributes: ERROR: column "info" is of type jsonb but expression is of type hstore
LINE 1: ...TE "geometria"."plan_perimetro_urbano" SET "info"=E'"bike"=>...
^
HINT: You will need to rewrite or cast the expression.

Screenshot121.png (25.2 KB) Felipe Souza, 2019-02-19 01:23 PM


Related issues

Copied to QGIS Application - Feature request #21315: add support for editing JSON PostgreSQL datatype Open 2019-02-19

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

I guess there is no support for this datatype, if confirmed then this would be a feature request (in the meantime please also check on 3.4.4/master so we can adjust the affected version to a recent one).

#2 Updated by Felipe Souza over 5 years ago

Giovanni Manghi wrote:

I guess there is no support for this datatype, if confirmed then this would be a feature request (in the meantime please also check on 3.4.4/master so we can adjust the affected version to a recent one).

OK. I have just checked it with 3.4.4 and I got the same error!

#3 Updated by Giovanni Manghi over 5 years ago

  • Affected QGIS version changed from 3.4.1 to 3.4.4

OK. I have just checked it with 3.4.4 and I got the same error!

that is not surprising. You should ask in the dev mailing list about the support for this data type, as said if this is not supported this must be changed to feature request.

#4 Updated by Felipe Souza over 5 years ago

#5 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to duplicate
  • Status changed from Feedback to Closed

Also available in: Atom PDF