Feature request #17040

Add PostgreSQL support for JSON field types along with UUID, XML, arrays, etc…

Added by Cory Albrecht almost 3 years ago. Updated over 2 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 #:24939

Description

To help with outputting to web maps with Leaflet or others, could PostgreSQL columns with the JSON data type be seen as a string?

Assuming I'm reading things correctly in the GitHub repo, at src/providers/postgres/qgspostgresprovider.cpp line 906 is an if clause of types that are seen as strings by QGIS, so all that would be needed would be a two extra lines for "json" and "jsonb". That way JSON columns could at least be seen and edited just like how XML and UUID columns are allowed, rather than ignored as they are now.

As an example usage case, I'm making an animated timeline map of the territorial evolution (also with the Time Manager plugin) and I wanted to have columns for predecessors for territories that merge and split (e.g. the four original provinces becoming Canada, the USSR splitting into independent countries) so when I make the web map I can write code to generate clickable links that reverse or fast-forward to the timeline positions where those predecessors or successors appear.

JSON would be the best format for that rather than, say, an array type because it wouldn't require any fancy parsing when passing to the JavaScript on to a webpage and could also take advantage of PG doing syntax checking and all the other JSON functionality in PG. I could also theoretically later extend the data in such a column to have granparent/-child or even sibling territories in the web map, too, without affecting QGIS.

Thanks in advance!

History

#1 Updated by Jürgen Fischer over 2 years ago

  • Assignee deleted (Jürgen Fischer)

Also available in: Atom PDF