@@ -563,7 +563,7 @@ void middle_pgsql_t::relation_delete(osmid_t osm_id)
563563void middle_pgsql_t::after_nodes ()
564564{
565565 m_db_copy.sync ();
566- if (m_options->flat_node_file .empty ()) {
566+ if (!m_options-> append && m_options->flat_node_file .empty ()) {
567567 auto const &table = m_tables.nodes ();
568568 analyze_table (m_db_connection, table.schema (), table.name ());
569569 }
@@ -572,15 +572,19 @@ void middle_pgsql_t::after_nodes()
572572void middle_pgsql_t::after_ways ()
573573{
574574 m_db_copy.sync ();
575- auto const &table = m_tables.ways ();
576- analyze_table (m_db_connection, table.schema (), table.name ());
575+ if (!m_options->append ) {
576+ auto const &table = m_tables.ways ();
577+ analyze_table (m_db_connection, table.schema (), table.name ());
578+ }
577579}
578580
579581void middle_pgsql_t::after_relations ()
580582{
581583 m_db_copy.sync ();
582- auto const &table = m_tables.relations ();
583- analyze_table (m_db_connection, table.schema (), table.name ());
584+ if (!m_options->append ) {
585+ auto const &table = m_tables.relations ();
586+ analyze_table (m_db_connection, table.schema (), table.name ());
587+ }
584588
585589 // release the copy thread and its database connection
586590 m_copy_thread->finish ();
0 commit comments