Skip to content

Commit 55a61c6

Browse files
committed
Fix index tablespace sql
1 parent c28979b commit 55a61c6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/middle-pgsql.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,21 @@
3232

3333
static 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

4648
middle_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[],"

src/middle-pgsql.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct middle_pgsql_t : public slim_middle_t
8989
{
9090
public:
9191
table_desc() {}
92-
table_desc(options_t const &options, const table_sql &ts);
92+
table_desc(options_t const &options, table_sql const &ts);
9393

9494
char const *name() const { return m_copy_target->name.c_str(); }
9595
void clear_array_indexes() { m_array_indexes.clear(); }

0 commit comments

Comments
 (0)