[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 09:44:04 UTC 2020


@joto commented on this pull request.



>  
 void pg_conn_t::exec(std::string const &sql) const
 {
-    query(PGRES_COMMAND_OK, sql.c_str());
+    if (!sql.empty()) {
+        query(PGRES_COMMAND_OK, sql.c_str());
+    }

Because of [this `if`](https://github.com/openstreetmap/osm2pgsql/blob/cd9770b2d724f4e7602b50659acc6684d86d3a51/src/middle-pgsql.cpp#L634), `sql.create_table` and `sql.prepare_query` can be empty, but they are still run. It was easiest to just not run empty queries instead of putting checks in more places.

For consistency I decided to add the emptyness check in both `exec` functions.

-- 
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_r507612721
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20201019/70632f59/attachment-0001.htm>


More information about the Tile-serving mailing list