Skip to content

Conversation

@joto
Copy link
Collaborator

@joto joto commented Sep 15, 2024

(Changes to) Properties are stored at a later time in the database so the db is not changed if osm2pgsql fails for some reason. Basically we are trying to do as many checks as possible before actually writing the properties to the db. For instance the input file is now actually opened before properties are written,

This solves some cases already mentioned in PR #2085.

Property changes were reflected piece by piece in the database. This
changes it so they are only done in one go after all the changes have
been made. So if something fails before we get to the point where we
write all properties to the database, no updates are actually done.

And the code is simpler because we keep track of necessary database
updates automatically and do them the next time the store() function is
called.
If osm2pgsql fails during initialization, for instance because the input
file or the style file was not found, it had already initialized the
osm2pgsql_properties table in the database. We now write the properties
table later to reduce the chances that a small error on the command line
destroys an existing database this way.
@joto joto force-pushed the robust-properties branch from 451b2e9 to 7b77762 Compare September 16, 2024 12:37
@lonvia lonvia merged commit fa5b152 into osm2pgsql-dev:master Sep 16, 2024
27 checks passed
@joto joto deleted the robust-properties branch September 17, 2024 07:50
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.

2 participants