[Tile-serving] [openstreetmap/osm2pgsql] Do not create planet_osm_nodes table if flat nodes are used (#1292)
Jochen Topf
notifications at github.com
Mon Oct 19 07:10:47 UTC 2020
@joto commented on this pull request.
> @@ -577,13 +577,15 @@ void middle_pgsql_t::start()
} else {
// (Re)create tables.
m_db_connection.exec("SET client_min_messages = WARNING");
- for (auto &table : m_tables) {
- fmt::print(stderr, "Setting up table: {}\n", table.name());
- auto const qual_name = qualified_name(
- table.m_copy_target->schema, table.m_copy_target->name);
- m_db_connection.exec(
- "DROP TABLE IF EXISTS {} CASCADE"_format(qual_name));
- m_db_connection.exec(table.m_create);
+ for (auto const &table : m_tables) {
+ if (!table.m_create.empty()) {
+ fmt::print(stderr, "Setting up table: {}\n", table.name());
+ auto const qual_name = qualified_name(
+ table.m_copy_target->schema, table.m_copy_target->name);
+ m_db_connection.exec(
+ "DROP TABLE IF EXISTS {} CASCADE"_format(qual_name));
Should we check whether there is data in there before dropping it? Or maybe just warn the user?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1292#discussion_r507519321
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20201019/aa20e81b/attachment.htm>
More information about the Tile-serving
mailing list