<p></p>
<p><b>@lonvia</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/osm2pgsql/pull/1292#discussion_r506685376">src/middle-pgsql.cpp</a>:</p>
<pre style='color:#555'>> @@ -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));
</pre>
<p>I think we should still try to drop the table here, just in case that it was left over from a previous run without flatnode store.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/osm2pgsql/pull/1292#discussion_r506690544">tests/regression.py</a>:</p>
<pre style='color:#555'>> @@ -749,6 +752,14 @@ class TestMPUpdateSlimLuaHstore(MultipolygonUpdateRunner, unittest.TestCase,
extra_params = ['--slim', '-k']
use_lua_tagtransform = True
+class TestMPUpdateSlimWithFlatNodes(MultipolygonUpdateRunner, unittest.TestCase,
+ MultipolygonTests):
+ extra_params = ['--slim', '-F', 'flat.nodes']
</pre>
<p>You'd need to add a cleanup for that file.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/osm2pgsql/pull/1292#discussion_r506691013">src/pgsql.cpp</a>:</p>
<pre style='color:#555'>>
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());
+ }
</pre>
<p>These two changes don't see really needed for this PR?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/1292#pullrequestreview-510752415">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353XX5BY2IH6Q5NAPZYLSLCQGRANCNFSM4STPJCLQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353SGQ6XEI2W54GZ6PF3SLCQGRA5CNFSM4STPJCL2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGODZYXNHY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/1292#pullrequestreview-510752415",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/1292#pullrequestreview-510752415",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>