@@ -96,8 +96,7 @@ void middle_pgsql_t::table_desc::stop(std::string const &conninfo,
9696
9797 if (droptemp) {
9898 log_info (" Dropping table '{}'" , name ());
99- auto const qual_name = qualified_name (
100- m_copy_target->schema , m_copy_target->name );
99+ auto const qual_name = qualified_name (schema (), name ());
101100 sql_conn.exec (" DROP TABLE IF EXISTS {}" _format (qual_name));
102101 } else if (build_indexes && !m_create_fw_dep_indexes.empty ()) {
103102 log_info (" Building index on table '{}'" , name ());
@@ -312,7 +311,7 @@ void middle_pgsql_t::node_set(osmium::Node const &node)
312311 if (m_options->flat_node_cache_enabled ) {
313312 m_persistent_cache->set (node.id (), node.location ());
314313 } else {
315- m_db_copy.new_line (m_tables[NODE_TABLE].m_copy_target );
314+ m_db_copy.new_line (m_tables[NODE_TABLE].copy_target () );
316315
317316 m_db_copy.add_columns (node.id (), node.location ().y (),
318317 node.location ().x ());
@@ -334,7 +333,7 @@ void middle_pgsql_t::node_delete(osmid_t osm_id)
334333 if (m_options->flat_node_cache_enabled ) {
335334 m_persistent_cache->set (osm_id, osmium::Location{});
336335 } else {
337- m_db_copy.new_line (m_tables[NODE_TABLE].m_copy_target );
336+ m_db_copy.new_line (m_tables[NODE_TABLE].copy_target () );
338337 m_db_copy.delete_object (osm_id);
339338 }
340339}
@@ -367,7 +366,7 @@ idlist_t middle_pgsql_t::get_rels_by_way(osmid_t osm_id)
367366
368367void middle_pgsql_t::way_set (osmium::Way const &way)
369368{
370- m_db_copy.new_line (m_tables[WAY_TABLE].m_copy_target );
369+ m_db_copy.new_line (m_tables[WAY_TABLE].copy_target () );
371370
372371 m_db_copy.add_column (way.id ());
373372
@@ -461,7 +460,7 @@ middle_query_pgsql_t::rel_way_members_get(osmium::Relation const &rel,
461460void middle_pgsql_t::way_delete (osmid_t osm_id)
462461{
463462 assert (m_options->append );
464- m_db_copy.new_line (m_tables[WAY_TABLE].m_copy_target );
463+ m_db_copy.new_line (m_tables[WAY_TABLE].copy_target () );
465464 m_db_copy.delete_object (osm_id);
466465}
467466
@@ -474,7 +473,7 @@ void middle_pgsql_t::relation_set(osmium::Relation const &rel)
474473 parts[osmium::item_type_to_nwr_index (m.type ())].push_back (m.ref ());
475474 }
476475
477- m_db_copy.new_line (m_tables[REL_TABLE].m_copy_target );
476+ m_db_copy.new_line (m_tables[REL_TABLE].copy_target () );
478477
479478 // id, way offset, relation offset
480479 m_db_copy.add_columns (rel.id (), parts[0 ].size (),
@@ -535,7 +534,7 @@ void middle_pgsql_t::relation_delete(osmid_t osm_id)
535534{
536535 assert (m_options->append );
537536
538- m_db_copy.new_line (m_tables[REL_TABLE].m_copy_target );
537+ m_db_copy.new_line (m_tables[REL_TABLE].copy_target () );
539538 m_db_copy.delete_object (osm_id);
540539}
541540
@@ -576,8 +575,7 @@ void middle_pgsql_t::start()
576575 m_db_connection.exec (" SET client_min_messages = WARNING" );
577576 for (auto const &table : m_tables) {
578577 log_debug (" Setting up table '{}'" , table.name ());
579- auto const qual_name = qualified_name (
580- table.m_copy_target ->schema , table.m_copy_target ->name );
578+ auto const qual_name = qualified_name (table.schema (), table.name ());
581579 m_db_connection.exec (
582580 " DROP TABLE IF EXISTS {} CASCADE" _format (qual_name));
583581 m_db_connection.exec (table.m_create_table );
0 commit comments