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

Flex config #1496

Merged
merged 3 commits into from
May 16, 2021
Merged

Flex config #1496

merged 3 commits into from
May 16, 2021

Conversation

joto
Copy link
Collaborator

@joto joto commented May 14, 2021

  • Test more of the flex config files
  • Use jsonb instead of hstore in most flex config files

joto added 2 commits May 14, 2021 09:47
The jsonb data type is built into PostgreSQL, no hstore extension is
needed. It is more flexible and there are more functions to extract
data from it.
@mboeringa
Copy link

mboeringa commented May 15, 2021

@joto, while I understand the desire to add jsonb as an additional type of tag storage column, wouldn't it be better to stick with hstore as default?

hstore has been the default for quite some time, and many people may have written quite extensive SQL statements using the required syntax. Switching to jsonb might break quite a lot of existing workflows.

From a pure user perspective, there is little to gain by switching to jsonb. hstore offers most of what users likely need.

Also see the comments by Paul and Sarah here: #672

@joto
Copy link
Collaborator Author

joto commented May 15, 2021

There is only one reason to stay with hstore: "we have always done it this way". Everything else points to json: better support in PostgreSQL, builtin (no "CREATE EXTENSION" needed), "industry standard", easier to understand for new users. I believe the advantages are large enough to make this the new standard. In a few years, nobody will even remember "the old ways" of doing things. But, its only in config files, so everybody can make the choice if and when to switch as they see fit. But default configs and the documentation should point to whatever is currently considered best and recommended usw.

Also: The comments on #672 do not apply here. JSON support is already available and is easy to switch between hstore and json, there is no need for more command line options. So while it was hard to switch before, now it is easy.

@mboeringa
Copy link

Ok, reasonable arguments. Curious when all this is going to land...

@lonvia lonvia merged commit 165065e into osm2pgsql-dev:master May 16, 2021
@mboeringa
Copy link

@joto

As to the switch to json, this does raise one question: since json supports nested (dictionary like) structures, I wondered how the upcoming new implementation saves the tags?

I guess it is just a flat structure, because I don't see any use for a nested structure in the context of OSM objects, so I can use:

tags ->> 'seasonal'

json syntax instead of the equivalent:

tags -> 'seasonal'

for hstore?

Or do you plan to have a root level, and I do need slightly more complex syntax than this?

@joto joto deleted the flex-config branch May 17, 2021 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants