Skip to content

Commit

Permalink
Refuse to import data when there is an osm2pgsql_properties table
Browse files Browse the repository at this point in the history
This checks stops users from clobbering an existing database.
  • Loading branch information
joto committed Nov 7, 2023
1 parent fbdfef8 commit 63ae5ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/osm2pgsql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,11 @@ int main(int argc, char *argv[])
}
}
} else {
if (has_table(options.middle_dbschema, "osm2pgsql_properties")) {
throw std::runtime_error{
"Cowardly refusing to import data into database that"
" already has osm2pgsql_properties table."};
}
check_and_set_style(&options);
store_properties(&properties, options);
auto const finfo = run(options);
Expand Down

0 comments on commit 63ae5ea

Please sign in to comment.