Feature request #21315

add support for editing JSON PostgreSQL datatype

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

Status:Open
Priority:Normal
Assignee:-
Category:Data Provider/PostGIS
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:29133

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 from QGIS Application - Bug report #21310: JSON column from a Postgresql Database is working to read... Closed 2019-02-19

History

#1 Updated by Felipe Souza over 5 years ago

  • Copied from 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

#2 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Feedback to Open
  • Subject changed from JSON column from a Postgresql Database is working to read information, but when editing the column and saving it, an error occurs to add support for editing JSON PostgreSQL datatype

#3 Updated by Felipe Souza over 5 years ago

  • Assignee set to Giovanni Manghi

This can be a great tool when you don´t want the user to change the default data from your table, but you let them create filters.
Any news on this?
Thank you.

Felipe Souza wrote:

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.

#4 Updated by Giovanni Manghi over 5 years ago

  • Assignee deleted (Giovanni Manghi)

Also available in: Atom PDF