Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
qgib opened this issue Aug 19, 2017 · 2 comments
Closed
Labels
Data Provider Related to specific vector, raster or mesh data providers Feature Request

Comments

@qgib
Copy link
Contributor

qgib commented Aug 19, 2017

Author Name: Cory Albrecht (@CoryAlbrecht)
Original Redmine Issue: 17040

Redmine category:data_provider/postgis


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!

@qgib
Copy link
Contributor Author

qgib commented Sep 8, 2017

Author Name: Jürgen Fischer (@jef-n)


  • assigned_to_id removed Jürgen Fischer

@qgib qgib added Feature Request Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
@alexbruy
Copy link
Contributor

alexbruy commented Dec 3, 2023

Seems already possible in the latest master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Provider Related to specific vector, raster or mesh data providers Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants