3232
3333static std::string build_sql (options_t const &options, char const *templ)
3434{
35- std::string const index_tablespace {options.tblsslim_index .empty ()
35+ std::string const using_tablespace {options.tblsslim_index .empty ()
3636 ? " "
3737 : " USING INDEX TABLESPACE " +
3838 options.tblsslim_index };
3939 return fmt::format (
4040 templ, fmt::arg (" prefix" , options.prefix ),
4141 fmt::arg (" unlogged" , options.droptemp ? " UNLOGGED" : " " ),
42- fmt::arg (" index_tablespace" , index_tablespace),
43- fmt::arg (" data_tablespace" , tablespace_clause (options.tblsslim_data )));
42+ fmt::arg (" using_tablespace" , using_tablespace),
43+ fmt::arg (" data_tablespace" , tablespace_clause (options.tblsslim_data )),
44+ fmt::arg (" index_tablespace" ,
45+ tablespace_clause (options.tblsslim_index )));
4446}
4547
4648middle_pgsql_t ::table_desc::table_desc(options_t const &options,
47- const table_sql &ts)
49+ table_sql const &ts)
4850: m_create(build_sql(options, ts.create_table)),
4951 m_prepare_query (build_sql(options, ts.prepare_query)),
5052 m_prepare_intarray(build_sql(options, ts.prepare_mark)),
@@ -677,7 +679,7 @@ static table_sql sql_for_nodes() noexcept
677679 sql.name = " {prefix}_nodes" ;
678680
679681 sql.create_table = " CREATE {unlogged} TABLE {prefix}_nodes ("
680- " id int8 PRIMARY KEY {index_tablespace },"
682+ " id int8 PRIMARY KEY {using_tablespace },"
681683 " lat int4 NOT NULL,"
682684 " lon int4 NOT NULL"
683685 " ) {data_tablespace};\n " ;
@@ -696,7 +698,7 @@ static table_sql sql_for_ways() noexcept
696698 sql.name = " {prefix}_ways" ;
697699
698700 sql.create_table = " CREATE {unlogged} TABLE {prefix}_ways ("
699- " id int8 PRIMARY KEY {index_tablespace },"
701+ " id int8 PRIMARY KEY {using_tablespace },"
700702 " nodes int8[] NOT NULL,"
701703 " tags text[]"
702704 " ) {data_tablespace};\n " ;
@@ -731,7 +733,7 @@ static table_sql sql_for_relations() noexcept
731733 sql.name = " {prefix}_rels" ;
732734
733735 sql.create_table = " CREATE {unlogged} TABLE {prefix}_rels ("
734- " id int8 PRIMARY KEY {index_tablespace },"
736+ " id int8 PRIMARY KEY {using_tablespace },"
735737 " way_off int2,"
736738 " rel_off int2,"
737739 " parts int8[],"
0 commit comments